@openedx/frontend-base 1.0.0-alpha.13 → 1.0.0-alpha.15
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/README.md +3 -3
- package/dist/runtime/config/index.js +5 -1
- package/dist/runtime/config/index.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/initialize.js +4 -1
- package/dist/runtime/initialize.js.map +1 -1
- package/dist/runtime/jest.config.d.ts +0 -1
- package/dist/runtime/jest.config.js +0 -1
- package/dist/runtime/jest.config.js.map +1 -1
- package/dist/runtime/react/AuthenticatedPageRoute.d.ts +2 -0
- package/dist/runtime/react/AuthenticatedPageRoute.js +2 -0
- package/dist/runtime/react/AuthenticatedPageRoute.js.map +1 -1
- package/dist/runtime/react/NotFoundPage.d.ts +2 -0
- package/dist/runtime/react/NotFoundPage.js +14 -0
- package/dist/runtime/react/NotFoundPage.js.map +1 -0
- package/dist/runtime/react/index.d.ts +1 -0
- package/dist/runtime/react/index.js +1 -0
- package/dist/runtime/react/index.js.map +1 -1
- package/dist/runtime/routing/authenticatedLoader.d.ts +2 -0
- package/dist/runtime/routing/authenticatedLoader.js +27 -0
- package/dist/runtime/routing/authenticatedLoader.js.map +1 -0
- package/dist/runtime/routing/index.d.ts +1 -0
- package/dist/runtime/routing/index.js +1 -0
- package/dist/runtime/routing/index.js.map +1 -1
- package/dist/runtime/routing/utils.js +20 -5
- package/dist/runtime/routing/utils.js.map +1 -1
- package/dist/runtime/slots/Slot.d.ts +2 -1
- package/dist/runtime/slots/Slot.js +9 -4
- package/dist/runtime/slots/Slot.js.map +1 -1
- package/dist/runtime/slots/SlotContext.d.ts +1 -0
- package/dist/runtime/slots/SlotContext.js.map +1 -1
- package/dist/runtime/slots/hooks.d.ts +1 -0
- package/dist/runtime/slots/hooks.js +3 -3
- package/dist/runtime/slots/hooks.js.map +1 -1
- package/dist/runtime/slots/utils.d.ts +1 -1
- package/dist/runtime/slots/utils.js +2 -2
- package/dist/runtime/slots/utils.js.map +1 -1
- package/dist/runtime/slots/widget/hooks.d.ts +3 -3
- package/dist/runtime/slots/widget/hooks.js.map +1 -1
- package/dist/runtime/slots/widget/types.d.ts +8 -0
- package/dist/runtime/slots/widget/types.js.map +1 -1
- package/dist/runtime/slots/widget/utils.d.ts +2 -2
- package/dist/runtime/slots/widget/utils.js +20 -2
- package/dist/runtime/slots/widget/utils.js.map +1 -1
- package/dist/shell/Logo.js +4 -1
- package/dist/shell/Logo.js.map +1 -1
- package/dist/shell/dev/devHome/HomePage.js +3 -3
- package/dist/shell/dev/devHome/HomePage.js.map +1 -1
- package/dist/shell/dev/slotShowcase/HorizontalSlotLayout.js +2 -1
- package/dist/shell/dev/slotShowcase/HorizontalSlotLayout.js.map +1 -1
- package/dist/shell/dev/slotShowcase/LayoutWithOptions.js +2 -2
- package/dist/shell/dev/slotShowcase/LayoutWithOptions.js.map +1 -1
- package/dist/shell/dev/slotShowcase/SlotShowcasePage.d.ts +1 -0
- package/dist/shell/dev/slotShowcase/SlotShowcasePage.js +10 -1
- package/dist/shell/dev/slotShowcase/SlotShowcasePage.js.map +1 -1
- package/dist/shell/dev/slotShowcase/ToggleByRoleLayout.d.ts +1 -0
- package/dist/shell/dev/slotShowcase/ToggleByRoleLayout.js +11 -0
- package/dist/shell/dev/slotShowcase/ToggleByRoleLayout.js.map +1 -0
- package/dist/shell/dev/slotShowcase/WidgetWithOptions.js +1 -1
- package/dist/shell/dev/slotShowcase/WidgetWithOptions.js.map +1 -1
- package/dist/shell/dev/slotShowcase/app.js +76 -40
- package/dist/shell/dev/slotShowcase/app.js.map +1 -1
- package/dist/shell/header/AuthenticatedMenu.js +0 -2
- package/dist/shell/header/AuthenticatedMenu.js.map +1 -1
- package/dist/shell/jest.config.d.ts +0 -1
- package/dist/shell/jest.config.js +0 -1
- package/dist/shell/jest.config.js.map +1 -1
- package/dist/shell/router/createRouter.js +12 -1
- package/dist/shell/router/createRouter.js.map +1 -1
- package/dist/tools/babel.config.d.ts +2 -0
- package/dist/tools/babel.config.js +3 -0
- package/dist/tools/cli/openedx.js +1 -1
- package/dist/tools/cli/utils/formatter.js +1 -8
- package/dist/tools/eslint/base.eslint.config.js +4 -3
- package/dist/tools/jest/jest.config.d.ts +0 -1
- package/dist/tools/jest/jest.config.js +0 -1
- package/dist/tools/webpack/common-config/dev/getDevServer.js +1 -3
- package/dist/tools/webpack/plugins/html-webpack-new-relic-plugin/HtmlWebpackNewRelicPlugin.d.ts +1 -3
- package/dist/tools/webpack/utils/getPublicPath.js +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { NavDropdownMenuSlot } from '../..';
|
|
3
14
|
import LinkMenuItem from '../../menus/LinkMenuItem';
|
|
4
15
|
import { LayoutOperationTypes, WidgetOperationTypes, useSlotContext } from '../../../runtime';
|
|
5
16
|
import HorizontalSlotLayout from './HorizontalSlotLayout';
|
|
6
17
|
import SlotShowcasePage from './SlotShowcasePage';
|
|
7
18
|
import WidgetWithOptions from './WidgetWithOptions';
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
function Child({ title, op }) {
|
|
12
|
-
return (_jsxs("div", { children: [title, op && (_jsxs("span", { children: [' ', "(", _jsx("code", { children: op }), ")"] }))] }));
|
|
19
|
+
function Widget(_a) {
|
|
20
|
+
var { title, op, className } = _a, props = __rest(_a, ["title", "op", "className"]);
|
|
21
|
+
return (_jsxs("div", Object.assign({ className: `showcase-widget ${className !== null && className !== void 0 ? className : ''}` }, props, { children: [title, op && (_jsxs("span", { children: [' ', "(", _jsx("code", { children: op }), ")"] }))] })));
|
|
13
22
|
}
|
|
14
23
|
function TakesProps({ aSlotProp }) {
|
|
15
|
-
return (_jsxs("div", { children: ["And this is a slot prop that was passed down via props: ", _jsx("code", { children: aSlotProp })] }));
|
|
24
|
+
return (_jsxs("div", { className: "showcase-widget", children: ["And this is a slot prop that was passed down via props: ", _jsx("code", { children: aSlotProp })] }));
|
|
16
25
|
}
|
|
17
26
|
function TakesPropsViaContext() {
|
|
18
27
|
const slotContext = useSlotContext();
|
|
19
28
|
const aSlotProp = typeof slotContext.aSlotProp === 'string' ? slotContext.aSlotProp : 'foo';
|
|
20
|
-
return (_jsxs("div", { children: ["And this is the same prop, but accessed via slot context: ", _jsx("code", { children: aSlotProp })] }));
|
|
29
|
+
return (_jsxs("div", { className: "showcase-widget", children: ["And this is the same prop, but accessed via slot context: ", _jsx("code", { children: aSlotProp })] }));
|
|
21
30
|
}
|
|
22
31
|
const app = {
|
|
23
32
|
appId: 'org.openedx.frontend.app.slotShowcase',
|
|
@@ -35,19 +44,19 @@ const app = {
|
|
|
35
44
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',
|
|
36
45
|
id: 'org.openedx.frontend.widget.slotShowcase.simpleChild1',
|
|
37
46
|
op: WidgetOperationTypes.APPEND,
|
|
38
|
-
element: (_jsx(
|
|
47
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
39
48
|
},
|
|
40
49
|
{
|
|
41
50
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',
|
|
42
51
|
id: 'org.openedx.frontend.widget.slotShowcase.simpleChild2',
|
|
43
52
|
op: WidgetOperationTypes.APPEND,
|
|
44
|
-
element: (_jsx(
|
|
53
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
45
54
|
},
|
|
46
55
|
{
|
|
47
56
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',
|
|
48
57
|
id: 'org.openedx.frontend.widget.slotShowcase.simpleChild3',
|
|
49
58
|
op: WidgetOperationTypes.APPEND,
|
|
50
|
-
element: (_jsx(
|
|
59
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
51
60
|
},
|
|
52
61
|
{
|
|
53
62
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimpleWithDefaultContent',
|
|
@@ -66,38 +75,38 @@ const app = {
|
|
|
66
75
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',
|
|
67
76
|
id: 'org.openedx.frontend.widget.slotShowcase.customChild1',
|
|
68
77
|
op: WidgetOperationTypes.APPEND,
|
|
69
|
-
element: (_jsx(
|
|
78
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
70
79
|
},
|
|
71
80
|
{
|
|
72
81
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',
|
|
73
82
|
id: 'org.openedx.frontend.widget.slotShowcase.customChild2',
|
|
74
83
|
op: WidgetOperationTypes.APPEND,
|
|
75
|
-
element: (_jsx(
|
|
84
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
76
85
|
},
|
|
77
86
|
{
|
|
78
87
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',
|
|
79
88
|
id: 'org.openedx.frontend.widget.slotShowcase.customChild3',
|
|
80
89
|
op: WidgetOperationTypes.APPEND,
|
|
81
|
-
element: (_jsx(
|
|
90
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
82
91
|
},
|
|
83
92
|
// Override custom layout
|
|
84
93
|
{
|
|
85
94
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',
|
|
86
95
|
id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild1',
|
|
87
96
|
op: WidgetOperationTypes.APPEND,
|
|
88
|
-
element: (_jsx(
|
|
97
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
89
98
|
},
|
|
90
99
|
{
|
|
91
100
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',
|
|
92
101
|
id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild2',
|
|
93
102
|
op: WidgetOperationTypes.APPEND,
|
|
94
|
-
element: (_jsx(
|
|
103
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
95
104
|
},
|
|
96
105
|
{
|
|
97
106
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',
|
|
98
107
|
id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild3',
|
|
99
108
|
op: WidgetOperationTypes.APPEND,
|
|
100
|
-
element: (_jsx(
|
|
109
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
101
110
|
},
|
|
102
111
|
{
|
|
103
112
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',
|
|
@@ -109,44 +118,44 @@ const app = {
|
|
|
109
118
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',
|
|
110
119
|
op: LayoutOperationTypes.OPTIONS,
|
|
111
120
|
options: {
|
|
112
|
-
title:
|
|
121
|
+
title: 'Bar',
|
|
113
122
|
}
|
|
114
123
|
},
|
|
115
124
|
{
|
|
116
125
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',
|
|
117
126
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild1',
|
|
118
127
|
op: WidgetOperationTypes.APPEND,
|
|
119
|
-
element: (_jsx(
|
|
128
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
120
129
|
},
|
|
121
130
|
{
|
|
122
131
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',
|
|
123
132
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild2',
|
|
124
133
|
op: WidgetOperationTypes.APPEND,
|
|
125
|
-
element: (_jsx(
|
|
134
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
126
135
|
},
|
|
127
136
|
{
|
|
128
137
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',
|
|
129
138
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild3',
|
|
130
139
|
op: WidgetOperationTypes.APPEND,
|
|
131
|
-
element: (_jsx(
|
|
140
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
132
141
|
},
|
|
133
142
|
{
|
|
134
143
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',
|
|
135
144
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild1',
|
|
136
145
|
op: WidgetOperationTypes.APPEND,
|
|
137
|
-
element: (_jsx(
|
|
146
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
138
147
|
},
|
|
139
148
|
{
|
|
140
149
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',
|
|
141
150
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild2',
|
|
142
151
|
op: WidgetOperationTypes.APPEND,
|
|
143
|
-
element: (_jsx(
|
|
152
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
144
153
|
},
|
|
145
154
|
{
|
|
146
155
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',
|
|
147
156
|
id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild3',
|
|
148
157
|
op: WidgetOperationTypes.APPEND,
|
|
149
|
-
element: (_jsx(
|
|
158
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
150
159
|
},
|
|
151
160
|
// TODO: Override Layout
|
|
152
161
|
// Prepending
|
|
@@ -154,19 +163,19 @@ const app = {
|
|
|
154
163
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',
|
|
155
164
|
id: 'org.openedx.frontend.widget.slotShowcase.prependingChild1',
|
|
156
165
|
op: WidgetOperationTypes.APPEND,
|
|
157
|
-
element: (_jsx(
|
|
166
|
+
element: (_jsx(Widget, { title: "Widget One", op: "WidgetOperationTypes.APPEND" }))
|
|
158
167
|
},
|
|
159
168
|
{
|
|
160
169
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',
|
|
161
170
|
id: 'org.openedx.frontend.widget.slotShowcase.prependingChild2',
|
|
162
171
|
op: WidgetOperationTypes.APPEND,
|
|
163
|
-
element: (_jsx(
|
|
172
|
+
element: (_jsx(Widget, { title: "Widget Two", op: "WidgetOperationTypes.APPEND" }))
|
|
164
173
|
},
|
|
165
174
|
{
|
|
166
175
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',
|
|
167
176
|
id: 'org.openedx.frontend.widget.slotShowcase.prependingChild3',
|
|
168
177
|
op: WidgetOperationTypes.PREPEND,
|
|
169
|
-
element: (_jsx(
|
|
178
|
+
element: (_jsx(Widget, { title: "Widget Three", op: "WidgetOperationTypes.PREPEND" }))
|
|
170
179
|
},
|
|
171
180
|
// Inserting
|
|
172
181
|
{
|
|
@@ -174,77 +183,77 @@ const app = {
|
|
|
174
183
|
id: 'slot-showcase.inserting.child4',
|
|
175
184
|
op: WidgetOperationTypes.INSERT_AFTER,
|
|
176
185
|
relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',
|
|
177
|
-
element: (_jsx(
|
|
186
|
+
element: (_jsx(Widget, { title: "Widget Four", op: "WidgetOperationTypes.INSERT_AFTER" }))
|
|
178
187
|
},
|
|
179
188
|
{
|
|
180
189
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',
|
|
181
190
|
id: 'slot-showcase.inserting.child5',
|
|
182
191
|
op: WidgetOperationTypes.INSERT_BEFORE,
|
|
183
192
|
relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',
|
|
184
|
-
element: (_jsx(
|
|
193
|
+
element: (_jsx(Widget, { title: "Widget Five", op: "WidgetOperationTypes.INSERT_BEFORE" }))
|
|
185
194
|
},
|
|
186
195
|
{
|
|
187
196
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',
|
|
188
197
|
id: 'org.openedx.frontend.widget.slotShowcase.insertingChild1',
|
|
189
198
|
op: WidgetOperationTypes.APPEND,
|
|
190
|
-
element: (_jsx(
|
|
199
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
191
200
|
},
|
|
192
201
|
{
|
|
193
202
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',
|
|
194
203
|
id: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',
|
|
195
204
|
op: WidgetOperationTypes.APPEND,
|
|
196
|
-
element: (_jsx(
|
|
205
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
197
206
|
},
|
|
198
207
|
{
|
|
199
208
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',
|
|
200
209
|
id: 'org.openedx.frontend.widget.slotShowcase.insertingChild3',
|
|
201
210
|
op: WidgetOperationTypes.APPEND,
|
|
202
|
-
element: (_jsx(
|
|
211
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
203
212
|
},
|
|
204
213
|
// Replacing
|
|
205
214
|
{
|
|
206
215
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',
|
|
207
216
|
id: 'org.openedx.frontend.widget.slotShowcase.replacingChild1',
|
|
208
217
|
op: WidgetOperationTypes.APPEND,
|
|
209
|
-
element: (_jsx(
|
|
218
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
210
219
|
},
|
|
211
220
|
{
|
|
212
221
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',
|
|
213
222
|
id: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',
|
|
214
223
|
op: WidgetOperationTypes.APPEND,
|
|
215
|
-
element: (_jsx(
|
|
224
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
216
225
|
},
|
|
217
226
|
{
|
|
218
227
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',
|
|
219
228
|
id: 'org.openedx.frontend.widget.slotShowcase.replacingChild3',
|
|
220
229
|
op: WidgetOperationTypes.APPEND,
|
|
221
|
-
element: (_jsx(
|
|
230
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
222
231
|
},
|
|
223
232
|
{
|
|
224
233
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',
|
|
225
234
|
id: 'org.openedx.frontend.widget.slotShowcase.replacingChild4',
|
|
226
235
|
op: WidgetOperationTypes.REPLACE,
|
|
227
236
|
relatedId: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',
|
|
228
|
-
element: (_jsx(
|
|
237
|
+
element: (_jsx(Widget, { title: "Widget Four", op: "WidgetOperationTypes.REPLACE" }))
|
|
229
238
|
},
|
|
230
239
|
// Hiding
|
|
231
240
|
{
|
|
232
241
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',
|
|
233
242
|
id: 'org.openedx.frontend.widget.slotShowcase.removingChild1',
|
|
234
243
|
op: WidgetOperationTypes.APPEND,
|
|
235
|
-
element: (_jsx(
|
|
244
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
236
245
|
},
|
|
237
246
|
{
|
|
238
247
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',
|
|
239
248
|
id: 'org.openedx.frontend.widget.slotShowcase.removingChild2',
|
|
240
249
|
op: WidgetOperationTypes.APPEND,
|
|
241
|
-
element: (_jsx(
|
|
250
|
+
element: (_jsx(Widget, { title: "Widget Two" }))
|
|
242
251
|
},
|
|
243
252
|
{
|
|
244
253
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',
|
|
245
254
|
id: 'org.openedx.frontend.widget.slotShowcase.removingChild3',
|
|
246
255
|
op: WidgetOperationTypes.APPEND,
|
|
247
|
-
element: (_jsx(
|
|
256
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
248
257
|
},
|
|
249
258
|
{
|
|
250
259
|
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',
|
|
@@ -269,9 +278,36 @@ const app = {
|
|
|
269
278
|
relatedId: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild2',
|
|
270
279
|
op: WidgetOperationTypes.OPTIONS,
|
|
271
280
|
options: {
|
|
272
|
-
title:
|
|
281
|
+
title: 'Bar',
|
|
273
282
|
}
|
|
274
283
|
},
|
|
284
|
+
// Widget filtering by role
|
|
285
|
+
{
|
|
286
|
+
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',
|
|
287
|
+
id: 'org.openedx.frontend.widget.slotShowcase.filterChild1',
|
|
288
|
+
op: WidgetOperationTypes.APPEND,
|
|
289
|
+
element: (_jsx(Widget, { title: "Widget One" }))
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',
|
|
293
|
+
id: 'org.openedx.frontend.widget.slotShowcase.filterChild2',
|
|
294
|
+
role: 'org.openedx.frontend.role.slotShowcase.highlighted',
|
|
295
|
+
op: WidgetOperationTypes.APPEND,
|
|
296
|
+
element: (_jsx(Widget, { title: "Widget Two (highlighted)", className: "showcase-widget-highlighted" }))
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',
|
|
300
|
+
id: 'org.openedx.frontend.widget.slotShowcase.filterChild3',
|
|
301
|
+
op: WidgetOperationTypes.APPEND,
|
|
302
|
+
element: (_jsx(Widget, { title: "Widget Three" }))
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',
|
|
306
|
+
id: 'org.openedx.frontend.widget.slotShowcase.filterChild4',
|
|
307
|
+
role: 'org.openedx.frontend.role.slotShowcase.highlighted',
|
|
308
|
+
op: WidgetOperationTypes.APPEND,
|
|
309
|
+
element: (_jsx(Widget, { title: "Widget Four (highlighted)", className: "showcase-widget-highlighted" }))
|
|
310
|
+
},
|
|
275
311
|
// Header
|
|
276
312
|
{
|
|
277
313
|
slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../shell/dev/slotShowcase/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9F,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,EAAkC;IAC1D,OAAO,CACL,2BACG,KAAK,EACL,EAAE,IAAI,CACL,8BAAG,GAAG,OAAE,yBAAO,EAAE,GAAQ,SAAI,CAC9B,IACI,CACR,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,EAAkC;IAC1D,OAAO,CACL,0BACG,KAAK,EACL,EAAE,IAAI,CACL,2BAAO,GAAG,OAAE,yBAAO,EAAE,GAAQ,SAAQ,CACtC,IACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAyB;IACtD,OAAO,CACL,sFAA6D,yBAAO,SAAS,GAAQ,IAAM,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S,GAAG,CAAC;YACpE,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,wCAAwC,CAAC;aACnD;SACF;QACD;YACE,MAAM,EAAE,kDAAkD;YAC1D,EAAE,EAAE,sDAAsD;YAC1D,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,CAAC,KAAC,YAAY,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,EAAC,OAAO,EAAC,SAAS,GAAG,CAAC;YACpE,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,wCAAwC,CAAC;aACnD;SACF;KACF;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { NavDropdownMenuSlot } from '../..';\nimport LinkMenuItem from '../../menus/LinkMenuItem';\nimport { LayoutOperationTypes, WidgetOperationTypes, useSlotContext } from '../../../runtime';\nimport { App } from '../../../types';\nimport HorizontalSlotLayout from './HorizontalSlotLayout';\nimport SlotShowcasePage from './SlotShowcasePage';\nimport WidgetWithOptions from './WidgetWithOptions';\n\nfunction Title({ title, op }: { title: string, op?: string }) {\n return (\n <span>\n {title}\n {op && (\n <>{' '}(<code>{op}</code>)</>\n )}\n </span>\n );\n}\n\nfunction Child({ title, op }: { title: string, op?: string }) {\n return (\n <div>\n {title}\n {op && (\n <span>{' '}(<code>{op}</code>)</span>\n )}\n </div>\n );\n}\n\nfunction TakesProps({ aSlotProp }: { aSlotProp: string }) {\n return (\n <div>And this is a slot prop that was passed down via props: <code>{aSlotProp}</code></div>\n );\n}\n\nfunction TakesPropsViaContext() {\n const slotContext = useSlotContext();\n const aSlotProp = typeof slotContext.aSlotProp === 'string' ? slotContext.aSlotProp : 'foo';\n return (\n <div>And this is the same prop, but accessed via slot context: <code>{aSlotProp}</code></div>\n );\n}\n\nconst app: App = {\n appId: 'org.openedx.frontend.app.slotShowcase',\n routes: [{\n id: 'org.openedx.frontend.route.slotShowcase',\n path: '/slots',\n Component: SlotShowcasePage,\n handle: {\n role: 'org.openedx.frontend.role.slotShowcase',\n }\n }],\n slots: [\n // Simple\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimpleWithDefaultContent',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild4',\n op: WidgetOperationTypes.APPEND,\n component: TakesProps\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimpleWithDefaultContent',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild5',\n op: WidgetOperationTypes.APPEND,\n component: TakesPropsViaContext\n },\n\n // Custom Layout\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n\n // Override custom layout\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n op: LayoutOperationTypes.REPLACE,\n element: <HorizontalSlotLayout />,\n },\n\n // Layout Options\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n op: LayoutOperationTypes.OPTIONS,\n options: {\n title: (<Title title=\"Bar\" op=\"LayoutOperationTypes.OPTIONS\" />),\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n\n // TODO: Override Layout\n\n // Prepending\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" op=\"WidgetOperationTypes.APPEND\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" op=\"WidgetOperationTypes.APPEND\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild3',\n op: WidgetOperationTypes.PREPEND,\n element: (<Child title=\"Child Three\" op=\"WidgetOperationTypes.PREPEND\" />)\n },\n\n // Inserting\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'slot-showcase.inserting.child4',\n op: WidgetOperationTypes.INSERT_AFTER,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n element: (<Child title=\"Child Four\" op=\"WidgetOperationTypes.INSERT_AFTER\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'slot-showcase.inserting.child5',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n element: (<Child title=\"Child Five\" op=\"WidgetOperationTypes.INSERT_BEFORE\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n\n // Replacing\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild4',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',\n element: (<Child title=\"Child Four\" op=\"WidgetOperationTypes.REPLACE\" />)\n },\n\n // Hiding\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Child title=\"Child Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n op: WidgetOperationTypes.REMOVE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.removingChild2',\n },\n\n // Widget Options\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild1',\n op: WidgetOperationTypes.APPEND,\n component: WidgetWithOptions,\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild2',\n op: WidgetOperationTypes.APPEND,\n component: WidgetWithOptions,\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n relatedId: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild2',\n op: WidgetOperationTypes.OPTIONS,\n options: {\n title: (<Title title=\"Bar\" op=\"WidgetOperationTypes.OPTIONS\" />),\n }\n },\n\n // Header\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n relatedId: 'org.openedx.frontend.widget.slotShowcase.headerLink',\n op: WidgetOperationTypes.OPTIONS,\n options: {\n title: 'Courses (modified)',\n },\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLinkAfter3',\n op: WidgetOperationTypes.INSERT_AFTER,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.headerLink3',\n element: (<LinkMenuItem label=\"Link After 3\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerPrimaryLinksDropdownPrepend',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <NavDropdownMenuSlot id=\"org.openedx.frontend.slot.header.primaryLinksDropdown.v1\" label=\"Resources\" />\n ),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase']\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinksDropdown.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerPrimaryLinksDropdownAppend',\n op: WidgetOperationTypes.APPEND,\n element: (\n <LinkMenuItem label=\"Resource 1\" url=\"#\" variant=\"dropdownItem\" />\n ),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLink3',\n op: WidgetOperationTypes.APPEND,\n element: (<LinkMenuItem label=\"Link 3\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLink4',\n op: WidgetOperationTypes.APPEND,\n element: (<LinkMenuItem label=\"Link 4\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n ]\n};\n\nexport default app;\n"]}
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../shell/dev/slotShowcase/app.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAk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,YAAY,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,EAAC,OAAO,EAAC,SAAS,GAAG,CAAC;YACpE,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,wCAAwC,CAAC;aACnD;SACF;QACD;YACE,MAAM,EAAE,kDAAkD;YAC1D,EAAE,EAAE,sDAAsD;YAC1D,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,CAAC,KAAC,YAAY,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,EAAC,OAAO,EAAC,SAAS,GAAG,CAAC;YACpE,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,wCAAwC,CAAC;aACnD;SACF;KACF;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { NavDropdownMenuSlot } from '../..';\nimport LinkMenuItem from '../../menus/LinkMenuItem';\nimport { LayoutOperationTypes, WidgetOperationTypes, useSlotContext } from '../../../runtime';\nimport { App } from '../../../types';\nimport HorizontalSlotLayout from './HorizontalSlotLayout';\nimport SlotShowcasePage from './SlotShowcasePage';\nimport WidgetWithOptions from './WidgetWithOptions';\n\nfunction Widget({ title, op, className, ...props }: { title: string, op?: string, className?: string } & Record<string, unknown>) {\n return (\n <div className={`showcase-widget ${className ?? ''}`} {...props}>\n {title}\n {op && (\n <span>{' '}(<code>{op}</code>)</span>\n )}\n </div>\n );\n}\n\nfunction TakesProps({ aSlotProp }: { aSlotProp: string }) {\n return (\n <div className=\"showcase-widget\">And this is a slot prop that was passed down via props: <code>{aSlotProp}</code></div>\n );\n}\n\nfunction TakesPropsViaContext() {\n const slotContext = useSlotContext();\n const aSlotProp = typeof slotContext.aSlotProp === 'string' ? slotContext.aSlotProp : 'foo';\n return (\n <div className=\"showcase-widget\">And this is the same prop, but accessed via slot context: <code>{aSlotProp}</code></div>\n );\n}\n\nconst app: App = {\n appId: 'org.openedx.frontend.app.slotShowcase',\n routes: [{\n id: 'org.openedx.frontend.route.slotShowcase',\n path: '/slots',\n Component: SlotShowcasePage,\n handle: {\n role: 'org.openedx.frontend.role.slotShowcase',\n }\n }],\n slots: [\n // Simple\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimple',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimpleWithDefaultContent',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild4',\n op: WidgetOperationTypes.APPEND,\n component: TakesProps\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseSimpleWithDefaultContent',\n id: 'org.openedx.frontend.widget.slotShowcase.simpleChild5',\n op: WidgetOperationTypes.APPEND,\n component: TakesPropsViaContext\n },\n\n // Custom Layout\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustom',\n id: 'org.openedx.frontend.widget.slotShowcase.customChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n\n // Override custom layout\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n id: 'org.openedx.frontend.widget.slotShowcase.customConfigChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseCustomConfig',\n op: LayoutOperationTypes.REPLACE,\n element: <HorizontalSlotLayout />,\n },\n\n // Layout Options\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n op: LayoutOperationTypes.OPTIONS,\n options: {\n title: 'Bar',\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseLayoutWithOptionsDefault',\n id: 'org.openedx.frontend.widget.slotShowcase.layoutWithOptionsDefaultChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n\n // TODO: Override Layout\n\n // Prepending\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" op=\"WidgetOperationTypes.APPEND\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" op=\"WidgetOperationTypes.APPEND\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcasePrepending',\n id: 'org.openedx.frontend.widget.slotShowcase.prependingChild3',\n op: WidgetOperationTypes.PREPEND,\n element: (<Widget title=\"Widget Three\" op=\"WidgetOperationTypes.PREPEND\" />)\n },\n\n // Inserting\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'slot-showcase.inserting.child4',\n op: WidgetOperationTypes.INSERT_AFTER,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n element: (<Widget title=\"Widget Four\" op=\"WidgetOperationTypes.INSERT_AFTER\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'slot-showcase.inserting.child5',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n element: (<Widget title=\"Widget Five\" op=\"WidgetOperationTypes.INSERT_BEFORE\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseInserting',\n id: 'org.openedx.frontend.widget.slotShowcase.insertingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n\n // Replacing\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseReplacing',\n id: 'org.openedx.frontend.widget.slotShowcase.replacingChild4',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.replacingChild2',\n element: (<Widget title=\"Widget Four\" op=\"WidgetOperationTypes.REPLACE\" />)\n },\n\n // Hiding\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild2',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n id: 'org.openedx.frontend.widget.slotShowcase.removingChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseRemoving',\n op: WidgetOperationTypes.REMOVE,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.removingChild2',\n },\n\n // Widget Options\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild1',\n op: WidgetOperationTypes.APPEND,\n component: WidgetWithOptions,\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n id: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild2',\n op: WidgetOperationTypes.APPEND,\n component: WidgetWithOptions,\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseWidgetOptions',\n relatedId: 'org.openedx.frontend.widget.slotShowcase.widgetOptionsChild2',\n op: WidgetOperationTypes.OPTIONS,\n options: {\n title: 'Bar',\n }\n },\n\n // Widget filtering by role\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',\n id: 'org.openedx.frontend.widget.slotShowcase.filterChild1',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget One\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',\n id: 'org.openedx.frontend.widget.slotShowcase.filterChild2',\n role: 'org.openedx.frontend.role.slotShowcase.highlighted',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Two (highlighted)\" className=\"showcase-widget-highlighted\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',\n id: 'org.openedx.frontend.widget.slotShowcase.filterChild3',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Three\" />)\n },\n {\n slotId: 'org.openedx.frontend.slot.dev.slotShowcaseFilterByRole',\n id: 'org.openedx.frontend.widget.slotShowcase.filterChild4',\n role: 'org.openedx.frontend.role.slotShowcase.highlighted',\n op: WidgetOperationTypes.APPEND,\n element: (<Widget title=\"Widget Four (highlighted)\" className=\"showcase-widget-highlighted\" />)\n },\n\n // Header\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n relatedId: 'org.openedx.frontend.widget.slotShowcase.headerLink',\n op: WidgetOperationTypes.OPTIONS,\n options: {\n title: 'Courses (modified)',\n },\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLinkAfter3',\n op: WidgetOperationTypes.INSERT_AFTER,\n relatedId: 'org.openedx.frontend.widget.slotShowcase.headerLink3',\n element: (<LinkMenuItem label=\"Link After 3\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerPrimaryLinksDropdownPrepend',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <NavDropdownMenuSlot id=\"org.openedx.frontend.slot.header.primaryLinksDropdown.v1\" label=\"Resources\" />\n ),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase']\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinksDropdown.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerPrimaryLinksDropdownAppend',\n op: WidgetOperationTypes.APPEND,\n element: (\n <LinkMenuItem label=\"Resource 1\" url=\"#\" variant=\"dropdownItem\" />\n ),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLink3',\n op: WidgetOperationTypes.APPEND,\n element: (<LinkMenuItem label=\"Link 3\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.slotShowcase.headerLink4',\n op: WidgetOperationTypes.APPEND,\n element: (<LinkMenuItem label=\"Link 4\" url=\"#\" variant=\"navLink\" />),\n condition: {\n active: ['org.openedx.frontend.role.slotShowcase'],\n }\n },\n ]\n};\n\nexport default app;\n"]}
|
|
@@ -4,8 +4,6 @@ import { Person } from '@openedx/paragon/icons';
|
|
|
4
4
|
import { Slot, useAuthenticatedUser } from '../../runtime';
|
|
5
5
|
export default function AuthenticatedMenu({ className }) {
|
|
6
6
|
const authenticatedUser = useAuthenticatedUser();
|
|
7
|
-
// We're using '||' on purpose to detect an empty string, so ignore eslint's warning:
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
9
7
|
const displayUserName = (authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.name) || (authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.username);
|
|
10
8
|
const title = (_jsxs("div", { className: "d-flex mr-2 align-items-center gap-2", children: [_jsx(Person, {}), displayUserName] }));
|
|
11
9
|
return (_jsx(DropdownButton, { size: "sm", id: "user-nav-dropdown", title: title, variant: "outline-primary", className: className, children: _jsx(Slot, { id: "org.openedx.frontend.slot.header.authenticatedMenu.v1" }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticatedMenu.js","sourceRoot":"","sources":["../../../shell/header/AuthenticatedMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAMvB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAA0B;IAC7E,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,
|
|
1
|
+
{"version":3,"file":"AuthenticatedMenu.js","sourceRoot":"","sources":["../../../shell/header/AuthenticatedMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAMvB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAA0B;IAC7E,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,MAAM,eAAe,GAAG,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,IAAI,MAAI,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,QAAQ,CAAA,CAAC;IAE/E,MAAM,KAAK,GAAG,CACZ,eAAK,SAAS,EAAC,sCAAsC,aACnD,KAAC,MAAM,KAAG,EACT,eAAe,IACZ,CACP,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,IAAC,IAAI,EAAC,IAAI,EAAC,EAAE,EAAC,mBAAmB,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,iBAAiB,EAAC,SAAS,EAAE,SAAS,YAC3G,KAAC,IAAI,IAAC,EAAE,EAAC,uDAAuD,GAAG,GACpD,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { DropdownButton } from '@openedx/paragon';\nimport { Person } from '@openedx/paragon/icons';\n\nimport {\n Slot,\n useAuthenticatedUser\n} from '../../runtime';\n\ninterface AuthenticatedMenuProps {\n className?: string,\n}\n\nexport default function AuthenticatedMenu({ className }: AuthenticatedMenuProps) {\n const authenticatedUser = useAuthenticatedUser();\n\n const displayUserName = authenticatedUser?.name || authenticatedUser?.username;\n\n const title = (\n <div className=\"d-flex mr-2 align-items-center gap-2\">\n <Person />\n {displayUserName}\n </div>\n );\n\n return (\n <DropdownButton size=\"sm\" id=\"user-nav-dropdown\" title={title} variant=\"outline-primary\" className={className}>\n <Slot id=\"org.openedx.frontend.slot.header.authenticatedMenu.v1\" />\n </DropdownButton>\n );\n}\n"]}
|
|
@@ -4,7 +4,6 @@ export let moduleNameMapper: {
|
|
|
4
4
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': string;
|
|
5
5
|
'\\.(css|scss)$': string;
|
|
6
6
|
'site.config': string;
|
|
7
|
-
'^@src/(.*)$': string;
|
|
8
7
|
};
|
|
9
8
|
export let testEnvironment: string;
|
|
10
9
|
export namespace testEnvironmentOptions {
|
|
@@ -8,7 +8,6 @@ module.exports = {
|
|
|
8
8
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/file.js',
|
|
9
9
|
'\\.(css|scss)$': require.resolve('identity-obj-proxy'),
|
|
10
10
|
'site.config': '<rootDir>/site.config.test.tsx',
|
|
11
|
-
'^@src/(.*)$': '<rootDir>/src/$1',
|
|
12
11
|
},
|
|
13
12
|
testEnvironment: 'jsdom',
|
|
14
13
|
testEnvironmentOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../shell/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,gBAAgB;KACjB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,6BAA6B;QAChH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../shell/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,gBAAgB;KACjB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,6BAA6B;QAChH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;KAChD;IACD,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE;QACtB,GAAG,EAAE,mBAAmB;KACzB;IACD,mBAAmB,EAAE;QACnB,gCAAgC;KACjC;IACD,0BAA0B,EAAE;QAC1B,gBAAgB;QAChB,cAAc;KACf;IACD,uBAAuB,EAAE;QACvB,oCAAoC;KACrC;IACD,sBAAsB,EAAE;QACtB,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;KACT;CACF,CAAC","sourcesContent":["module.exports = {\n setupFilesAfterEnv: [\n './setupTest.js',\n ],\n moduleNameMapper: {\n '\\\\.svg$': '<rootDir>/__mocks__/svg.js',\n '\\\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/file.js',\n '\\\\.(css|scss)$': require.resolve('identity-obj-proxy'),\n 'site.config': '<rootDir>/site.config.test.tsx',\n },\n testEnvironment: 'jsdom',\n testEnvironmentOptions: {\n url: 'http://localhost/',\n },\n collectCoverageFrom: [\n '<rootDir>/**/*.{js,jsx,ts,tsx}',\n ],\n coveragePathIgnorePatterns: [\n '/node_modules/',\n 'setupTest.js',\n ],\n transformIgnorePatterns: [\n '/node_modules/(?!(@openedx|@edx)/)',\n ],\n testPathIgnorePatterns: [\n '/site.config.test.tsx',\n '/node_modules/',\n '/dist/',\n ],\n};\n"]}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createBrowserRouter, isRouteErrorResponse, useRouteError } from 'react-router-dom';
|
|
2
3
|
import { getBasename } from '../../runtime/initialize';
|
|
4
|
+
import ErrorPage from '../../runtime/react/ErrorPage';
|
|
5
|
+
import NotFoundPage from '../../runtime/react/NotFoundPage';
|
|
3
6
|
import Shell from '../Shell';
|
|
4
7
|
import getAppRoutes from './getAppRoutes';
|
|
8
|
+
function RouteError() {
|
|
9
|
+
const error = useRouteError();
|
|
10
|
+
if (isRouteErrorResponse(error) && error.status === 404) {
|
|
11
|
+
return _jsx(NotFoundPage, {});
|
|
12
|
+
}
|
|
13
|
+
return _jsx(ErrorPage, {});
|
|
14
|
+
}
|
|
5
15
|
export default function createRouter() {
|
|
6
16
|
return createBrowserRouter([
|
|
7
17
|
{
|
|
8
18
|
Component: Shell,
|
|
19
|
+
errorElement: _jsx(RouteError, {}),
|
|
9
20
|
children: getAppRoutes(),
|
|
10
21
|
}
|
|
11
22
|
], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRouter.js","sourceRoot":"","sources":["../../../shell/router/createRouter.
|
|
1
|
+
{"version":3,"file":"createRouter.js","sourceRoot":"","sources":["../../../shell/router/createRouter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,MAAM,UAAU,CAAC;AAE7B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,SAAS,UAAU;IACjB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAE9B,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QACxD,OAAO,KAAC,YAAY,KAAG,CAAC;IAC1B,CAAC;IAED,OAAO,KAAC,SAAS,KAAG,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY;IAClC,OAAO,mBAAmB,CAAC;QACzB;YACE,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAC,UAAU,KAAG;YAC5B,QAAQ,EAAE,YAAY,EAAE;SACzB;KACF,EAAE;QACD,QAAQ,EAAE,WAAW,EAAE;KACxB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createBrowserRouter, isRouteErrorResponse, useRouteError } from 'react-router-dom';\n\nimport { getBasename } from '../../runtime/initialize';\nimport ErrorPage from '../../runtime/react/ErrorPage';\nimport NotFoundPage from '../../runtime/react/NotFoundPage';\nimport Shell from '../Shell';\n\nimport getAppRoutes from './getAppRoutes';\n\nfunction RouteError() {\n const error = useRouteError();\n\n if (isRouteErrorResponse(error) && error.status === 404) {\n return <NotFoundPage />;\n }\n\n return <ErrorPage />;\n}\n\nexport default function createRouter() {\n return createBrowserRouter([\n {\n Component: Shell,\n errorElement: <RouteError />,\n children: getAppRoutes(),\n }\n ], {\n basename: getBasename(),\n });\n}\n"]}
|
|
@@ -67,7 +67,7 @@ switch (commandName) {
|
|
|
67
67
|
'--format', path_1.default.resolve(__dirname, './utils/formatter.js'),
|
|
68
68
|
'--ignore', `${srcFoldersString}/**/*.json`,
|
|
69
69
|
'--ignore', `${srcFoldersString}/**/*.d.ts`,
|
|
70
|
-
'--out-file', './
|
|
70
|
+
'--out-file', './src/i18n/transifex_input.json',
|
|
71
71
|
'--', `${srcFoldersString}/**/*.{j,t}s*`,
|
|
72
72
|
]);
|
|
73
73
|
require('@formatjs/cli/bin/formatjs');
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.format = (messages) => {
|
|
4
|
-
const results = Object.entries(messages).map(([id, message]) => ({
|
|
5
|
-
id,
|
|
6
|
-
defaultMessage: message.defaultMessage,
|
|
7
|
-
description: message.description,
|
|
8
|
-
}));
|
|
9
|
-
return results;
|
|
10
|
-
};
|
|
3
|
+
exports.format = (messages) => Object.fromEntries(Object.entries(messages).map(([id, { defaultMessage }]) => [id, defaultMessage]));
|
|
@@ -79,6 +79,7 @@ module.exports = tseslint.config(eslint.configs.recommended, ...tseslint.configs
|
|
|
79
79
|
}],
|
|
80
80
|
'@typescript-eslint/no-empty-function': 'off',
|
|
81
81
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
82
|
+
'@typescript-eslint/prefer-optional-chain': 'off',
|
|
82
83
|
'@stylistic/semi': ['error', 'always', { omitLastInOneLineBlock: true, omitLastInOneLineClassBody: true }],
|
|
83
84
|
'@stylistic/quotes': ['error', 'single', {
|
|
84
85
|
avoidEscape: true,
|
|
@@ -103,9 +104,9 @@ module.exports = tseslint.config(eslint.configs.recommended, ...tseslint.configs
|
|
|
103
104
|
},
|
|
104
105
|
}, {
|
|
105
106
|
files: [
|
|
106
|
-
'babel.config.js',
|
|
107
|
-
'jest.config.js',
|
|
108
|
-
'eslint.config.js'
|
|
107
|
+
'**/babel.config.js',
|
|
108
|
+
'**/jest.config.js',
|
|
109
|
+
'**/eslint.config.js'
|
|
109
110
|
],
|
|
110
111
|
rules: {
|
|
111
112
|
'@typescript-eslint/no-require-imports': 'off'
|
|
@@ -9,7 +9,6 @@ module.exports = {
|
|
|
9
9
|
moduleNameMapper: {
|
|
10
10
|
'\\.(css|scss)$': require.resolve('identity-obj-proxy'),
|
|
11
11
|
'site.config': path.resolve(process.cwd(), './site.config.test.tsx'),
|
|
12
|
-
'^@src/(.*)$': '<rootDir>/src/$1',
|
|
13
12
|
},
|
|
14
13
|
collectCoverageFrom: [
|
|
15
14
|
'src/**/*.{js,jsx,ts,tsx}',
|
|
@@ -12,10 +12,8 @@ function getDevServer() {
|
|
|
12
12
|
headers: {
|
|
13
13
|
'Access-Control-Allow-Origin': '*',
|
|
14
14
|
},
|
|
15
|
-
// For obvious reasons, 'auto' won't work for publicPath here, so we
|
|
16
|
-
// force '/' unless PUBLIC_PATH is set.
|
|
17
15
|
historyApiFallback: {
|
|
18
|
-
index: path_1.default.join((0, getPublicPath_1.default)(
|
|
16
|
+
index: path_1.default.join((0, getPublicPath_1.default)(), 'index.html'),
|
|
19
17
|
disableDotRule: true,
|
|
20
18
|
},
|
|
21
19
|
host: 'apps.local.openedx.io',
|
package/dist/tools/webpack/plugins/html-webpack-new-relic-plugin/HtmlWebpackNewRelicPlugin.d.ts
CHANGED
|
@@ -6,9 +6,7 @@ declare enum OptionTypes {
|
|
|
6
6
|
LICENSE_KEY = "licenseKey",
|
|
7
7
|
TRUST_KEY = "trustKey"
|
|
8
8
|
}
|
|
9
|
-
type HtmlWebpackNewRelicPluginOptions =
|
|
10
|
-
[key in OptionTypes]: string | undefined;
|
|
11
|
-
};
|
|
9
|
+
type HtmlWebpackNewRelicPluginOptions = Record<OptionTypes, string | undefined>;
|
|
12
10
|
export default class HtmlWebpackNewRelicPlugin {
|
|
13
11
|
options: HtmlWebpackNewRelicPluginOptions;
|
|
14
12
|
newRelicString: string;
|