mui-toolpad-extended-tuni 1.0.3 → 2.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/README.md +47 -25
- package/dist/{EduMLToolpad → LMSToolpad}/EduMLProvider.d.ts +1 -0
- package/dist/LMSToolpad/LMSProvider.d.ts +26 -0
- package/dist/LMSToolpad/components/CenteredHeading.d.ts +7 -0
- package/dist/LMSToolpad/components/Courses/CourseCodeLoader.d.ts +15 -0
- package/dist/LMSToolpad/components/Courses/CourseInstanceLoader.d.ts +16 -0
- package/dist/LMSToolpad/components/Courses/CourseInstanceSelector.d.ts +15 -0
- package/dist/LMSToolpad/components/Courses/CourseItem.d.ts +25 -0
- package/dist/LMSToolpad/components/Courses/CourseList.d.ts +24 -0
- package/dist/LMSToolpad/components/Courses/CourseSelector.d.ts +23 -0
- package/dist/LMSToolpad/components/Courses/CourseTools.d.ts +22 -0
- package/dist/LMSToolpad/components/Courses/LayoutToggle.d.ts +7 -0
- package/dist/LMSToolpad/components/Home.d.ts +13 -0
- package/dist/LMSToolpad/components/MicroserviceNavigationBuilder.d.ts +45 -0
- package/dist/LMSToolpad/components/MicroserviceRoutes.d.ts +44 -0
- package/dist/LMSToolpad/components/ToolCard.d.ts +8 -0
- package/dist/LMSToolpad/components/ToolDisplayer.d.ts +21 -0
- package/dist/{EduMLToolpad → LMSToolpad}/components/sidebar/Footer.d.ts +2 -1
- package/dist/{EduMLToolpad → LMSToolpad}/constants.d.ts +1 -0
- package/dist/{EduMLToolpad → LMSToolpad}/hooks/useCustomRouter.d.ts +1 -0
- package/dist/{EduMLToolpad → LMSToolpad}/network/axiosConfig.d.ts +1 -0
- package/dist/LMSToolpad/store/useCourseStore.d.ts +31 -0
- package/dist/{EduMLToolpad → LMSToolpad}/store/useNavigationStore.d.ts +14 -0
- package/dist/LMSToolpad/utils/courseFilters.d.ts +14 -0
- package/dist/index.cjs +84 -84
- package/dist/index.d.ts +32 -24
- package/dist/index.es.js +6104 -5362
- package/package.json +1 -1
- package/dist/EduMLToolpad/components/Courses/CourseItem.d.ts +0 -9
- package/dist/EduMLToolpad/components/Courses/CourseList.d.ts +0 -9
- package/dist/EduMLToolpad/components/Courses/CourseSelector.d.ts +0 -3
- package/dist/EduMLToolpad/components/Courses/CourseTools.d.ts +0 -3
- package/dist/EduMLToolpad/components/Home.d.ts +0 -3
- package/dist/EduMLToolpad/store/useCourseStore.d.ts +0 -15
- package/dist/EduMLToolpad/utils/slugify.d.ts +0 -1
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Courses/LtiLoginUrlForm.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Courses/NoCoursesMessage.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/DevelopmentTools.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Dialogs/DialogOpener.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Dialogs/FormDialog.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/EduMLDialog.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/IconWithBadge.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/LoadingScreen.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Logo.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/Notifications.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/PageToolBar.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/ToolSelector.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/UserSwitcher.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/toolbar/Account.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/toolbar/Actions.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/tools/addActions.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/tools/addIcons.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/tools/iconsByType.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/tools/utils/ActionFCWrapper.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/components/tools/utils/IconFCWrapper.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/interfaces.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/layout/breadcrumbs/SizableContentHeader.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/network/courses.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/network/users.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/store/useDialogStore.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/store/useNotificationsStore.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/store/useUserStore.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/theme/EduMLTheme.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/tools/ErrorBoundary.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/tools/NullStateWarning.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/types/toolpad.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/types/vite-env.d.ts +0 -0
- /package/dist/{EduMLToolpad → LMSToolpad}/utils/caseConverter.d.ts +0 -0
package/README.md
CHANGED
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
A React library extending MUI Toolpad functionality with additional features for educational applications. This library provides components and tools for building interactive educational interfaces.
|
|
6
6
|
|
|
7
|
+
## Version 2.1.0
|
|
8
|
+
|
|
9
|
+
### Recent Changes
|
|
10
|
+
|
|
11
|
+
- Enhanced course navigation structure with support for course instances
|
|
12
|
+
- Improved MicroserviceRoutes component with better TypeScript support
|
|
13
|
+
- Added new CourseInstanceSelector and CourseCodeLoader components
|
|
14
|
+
- Updated navigation store with better course instance handling
|
|
15
|
+
- Introduced new course filtering utilities
|
|
16
|
+
- Improved sidebar footer with responsive design
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
|
|
20
|
+
- Navigation structure now requires course code and instance properties
|
|
21
|
+
- MicroserviceRoutes configuration requires updated navigation builder function
|
|
22
|
+
- Course data structure updated to include code and instance fields
|
|
23
|
+
|
|
24
|
+
## Breaking Changes in v2.0.0
|
|
25
|
+
|
|
26
|
+
1. Renamed `EduMLProvider` to `LMSProvider` (EduMLProvider is now deprecated)
|
|
27
|
+
2. All routing components must now be imported from this package
|
|
28
|
+
3. State management is now centralized through the package
|
|
29
|
+
|
|
7
30
|
## Prerequisites
|
|
8
31
|
|
|
9
32
|
This library requires the following peer dependencies:
|
|
@@ -18,21 +41,21 @@ This library requires the following peer dependencies:
|
|
|
18
41
|
## Installation
|
|
19
42
|
|
|
20
43
|
```bash
|
|
21
|
-
npm install
|
|
44
|
+
npm install mui-toolpad-extended-tuni
|
|
22
45
|
```
|
|
23
46
|
|
|
24
47
|
## Basic Usage
|
|
25
48
|
|
|
26
|
-
1.
|
|
49
|
+
1. Setup your application with `LMSProvider` and routing:
|
|
27
50
|
|
|
28
51
|
```tsx
|
|
29
52
|
import { BrowserRouter } from 'react-router-dom';
|
|
30
|
-
import {
|
|
53
|
+
import { LMSProvider } from 'mui-toolpad-extended-tuni';
|
|
31
54
|
|
|
32
55
|
function App() {
|
|
33
56
|
return (
|
|
34
57
|
<BrowserRouter>
|
|
35
|
-
<
|
|
58
|
+
<LMSProvider>{/* Your application content */}</LMSProvider>
|
|
36
59
|
</BrowserRouter>
|
|
37
60
|
);
|
|
38
61
|
}
|
|
@@ -45,7 +68,7 @@ import {
|
|
|
45
68
|
useUserStore,
|
|
46
69
|
useCourseStore,
|
|
47
70
|
useNavigationStore,
|
|
48
|
-
} from '
|
|
71
|
+
} from 'mui-toolpad-extended-tuni';
|
|
49
72
|
|
|
50
73
|
function MyComponent() {
|
|
51
74
|
const { user } = useUserStore();
|
|
@@ -62,20 +85,19 @@ function MyComponent() {
|
|
|
62
85
|
|
|
63
86
|
## Core Components
|
|
64
87
|
|
|
65
|
-
###
|
|
88
|
+
### LMSProvider
|
|
66
89
|
|
|
67
90
|
The main provider component that sets up the application context:
|
|
68
91
|
|
|
69
92
|
```tsx
|
|
70
|
-
import { BrowserRouter } from '
|
|
71
|
-
import { EduMLProvider } from '@jalez/mui-toolpad-extended-tuni';
|
|
93
|
+
import { LMSProvider, BrowserRouter } from 'mui-toolpad-extended-tuni';
|
|
72
94
|
|
|
73
95
|
function App() {
|
|
74
96
|
return (
|
|
75
97
|
<BrowserRouter>
|
|
76
|
-
<
|
|
98
|
+
<LMSProvider>
|
|
77
99
|
<YourComponents />
|
|
78
|
-
</
|
|
100
|
+
</LMSProvider>
|
|
79
101
|
</BrowserRouter>
|
|
80
102
|
);
|
|
81
103
|
}
|
|
@@ -86,7 +108,7 @@ function App() {
|
|
|
86
108
|
A customizable loading indicator with animations:
|
|
87
109
|
|
|
88
110
|
```tsx
|
|
89
|
-
import { LoadingScreen } from '
|
|
111
|
+
import { LoadingScreen } from 'mui-toolpad-extended-tuni';
|
|
90
112
|
|
|
91
113
|
function MyComponent() {
|
|
92
114
|
return isLoading ? <LoadingScreen /> : <YourContent />;
|
|
@@ -98,7 +120,7 @@ function MyComponent() {
|
|
|
98
120
|
Built-in notification system using notistack:
|
|
99
121
|
|
|
100
122
|
```tsx
|
|
101
|
-
import { useNotificationStore } from '
|
|
123
|
+
import { useNotificationStore } from 'mui-toolpad-extended-tuni';
|
|
102
124
|
|
|
103
125
|
function MyComponent() {
|
|
104
126
|
const { addNotificationData } = useNotificationStore();
|
|
@@ -113,20 +135,20 @@ function MyComponent() {
|
|
|
113
135
|
}
|
|
114
136
|
```
|
|
115
137
|
|
|
116
|
-
###
|
|
138
|
+
### ExtendedDialog
|
|
117
139
|
|
|
118
140
|
A responsive dialog component:
|
|
119
141
|
|
|
120
142
|
```tsx
|
|
121
|
-
import {
|
|
143
|
+
import { ExtendedDialog } from 'mui-toolpad-extended-tuni';
|
|
122
144
|
|
|
123
145
|
function MyComponent() {
|
|
124
146
|
const [open, setOpen] = useState(false);
|
|
125
147
|
|
|
126
148
|
return (
|
|
127
|
-
<
|
|
149
|
+
<ExtendedDialog open={open} onClose={() => setOpen(false)}>
|
|
128
150
|
<DialogContent>Your content here</DialogContent>
|
|
129
|
-
</
|
|
151
|
+
</ExtendedDialog>
|
|
130
152
|
);
|
|
131
153
|
}
|
|
132
154
|
```
|
|
@@ -138,7 +160,7 @@ function MyComponent() {
|
|
|
138
160
|
A component for listing and selecting courses:
|
|
139
161
|
|
|
140
162
|
```tsx
|
|
141
|
-
import { CourseSelector } from '
|
|
163
|
+
import { CourseSelector } from 'mui-toolpad-extended-tuni';
|
|
142
164
|
|
|
143
165
|
function MyComponent() {
|
|
144
166
|
return <CourseSelector />;
|
|
@@ -150,7 +172,7 @@ function MyComponent() {
|
|
|
150
172
|
Manages course-specific tools and LTI configuration:
|
|
151
173
|
|
|
152
174
|
```tsx
|
|
153
|
-
import { CourseTools } from '
|
|
175
|
+
import { CourseTools } from 'mui-toolpad-extended-tuni';
|
|
154
176
|
|
|
155
177
|
function MyComponent() {
|
|
156
178
|
return <CourseTools />;
|
|
@@ -162,7 +184,7 @@ function MyComponent() {
|
|
|
162
184
|
For teachers to set up course authentication:
|
|
163
185
|
|
|
164
186
|
```tsx
|
|
165
|
-
import { LtiLoginUrlForm } from '
|
|
187
|
+
import { LtiLoginUrlForm } from 'mui-toolpad-extended-tuni';
|
|
166
188
|
|
|
167
189
|
function MyComponent() {
|
|
168
190
|
return <LtiLoginUrlForm />;
|
|
@@ -176,7 +198,7 @@ function MyComponent() {
|
|
|
176
198
|
Catches and handles React component errors:
|
|
177
199
|
|
|
178
200
|
```tsx
|
|
179
|
-
import { ErrorBoundary } from '
|
|
201
|
+
import { ErrorBoundary } from 'mui-toolpad-extended-tuni';
|
|
180
202
|
|
|
181
203
|
function App() {
|
|
182
204
|
return (
|
|
@@ -192,7 +214,7 @@ function App() {
|
|
|
192
214
|
Detects and displays warnings for null states:
|
|
193
215
|
|
|
194
216
|
```tsx
|
|
195
|
-
import { NullStateWarning } from '
|
|
217
|
+
import { NullStateWarning } from 'mui-toolpad-extended-tuni';
|
|
196
218
|
|
|
197
219
|
function MyComponent() {
|
|
198
220
|
const states = [{ user: currentUser }, { course: currentCourse }];
|
|
@@ -274,7 +296,7 @@ import {
|
|
|
274
296
|
slugify,
|
|
275
297
|
camelCaseToUnderscore,
|
|
276
298
|
underscoreToCamelCase,
|
|
277
|
-
} from '
|
|
299
|
+
} from 'mui-toolpad-extended-tuni';
|
|
278
300
|
|
|
279
301
|
// Convert strings to URL-friendly format
|
|
280
302
|
const slug = slugify('My Course Title'); // 'my-course-title'
|
|
@@ -290,7 +312,7 @@ const camelCase = underscoreToCamelCase('my_variable'); // 'myVariable'
|
|
|
290
312
|
import {
|
|
291
313
|
convertObjectKeysToCamelCase,
|
|
292
314
|
convertObjectKeysToUnderscore,
|
|
293
|
-
} from '
|
|
315
|
+
} from 'mui-toolpad-extended-tuni';
|
|
294
316
|
|
|
295
317
|
// Convert API responses
|
|
296
318
|
const camelCaseData = convertObjectKeysToCamelCase(apiResponse);
|
|
@@ -302,7 +324,7 @@ const underscoreData = convertObjectKeysToUnderscore(requestData);
|
|
|
302
324
|
The library includes pre-configured Axios instance for API communications:
|
|
303
325
|
|
|
304
326
|
```tsx
|
|
305
|
-
import { axiosInstance } from '
|
|
327
|
+
import { axiosInstance } from 'mui-toolpad-extended-tuni';
|
|
306
328
|
|
|
307
329
|
// Handles CSRF tokens and base URL automatically
|
|
308
330
|
const response = await axiosInstance.get('/api/endpoint');
|
|
@@ -332,7 +354,7 @@ interface CourseRaw {
|
|
|
332
354
|
The library includes a customizable Material-UI theme:
|
|
333
355
|
|
|
334
356
|
```tsx
|
|
335
|
-
import { EduMLTheme } from '
|
|
357
|
+
import { EduMLTheme } from 'mui-toolpad-extended-tuni';
|
|
336
358
|
|
|
337
359
|
// Theme includes predefined:
|
|
338
360
|
// - Color schemes (light/dark)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface EduMLProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Main provider component for the LMS system.
|
|
8
|
+
*
|
|
9
|
+
* @version 2.1.0
|
|
10
|
+
* @breaking-changes
|
|
11
|
+
* - Renamed from EduMLProvider to LMSProvider
|
|
12
|
+
* - Updated authentication handling for course instances
|
|
13
|
+
* - Added support for course code level navigation
|
|
14
|
+
* - Improved context sharing between microservices
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <BrowserRouter>
|
|
19
|
+
* <LMSProvider>
|
|
20
|
+
* {children}
|
|
21
|
+
* </LMSProvider>
|
|
22
|
+
* </BrowserRouter>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const LMSProvider: ({ children }: EduMLProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default LMSProvider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for loading and managing course code level data.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Handles course code level routing
|
|
8
|
+
* - Manages course code state in store
|
|
9
|
+
* - Provides course instance list context
|
|
10
|
+
* - Supports navigation between instances
|
|
11
|
+
* @description - This component is responsible for loading the course data and rendering the course tools
|
|
12
|
+
* @returns {React.ReactElement} - Returns the course loader component
|
|
13
|
+
*/
|
|
14
|
+
declare const CourseCodeLoader: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default CourseCodeLoader;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for loading specific course instance data.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Manages course instance state
|
|
8
|
+
* - Handles instance-specific data loading
|
|
9
|
+
* - Provides instance context to children
|
|
10
|
+
* - Supports microservice integration
|
|
11
|
+
* - Handles instance not found scenarios
|
|
12
|
+
* @description - This component is responsible for loading the course data and rendering the course tools
|
|
13
|
+
* @returns {React.ReactElement} - Returns the course loader component
|
|
14
|
+
*/
|
|
15
|
+
declare const CourseInstanceLoader: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default CourseInstanceLoader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for selecting course instances from a filtered list.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Provides instance selection UI for courses
|
|
8
|
+
* - Groups instances by course code
|
|
9
|
+
* - Handles active/inactive instance states
|
|
10
|
+
* - Supports nested navigation structure
|
|
11
|
+
*
|
|
12
|
+
* @param {Course[]} courses - Available course instances
|
|
13
|
+
*/
|
|
14
|
+
declare const CourseInstanceSelector: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default CourseInstanceSelector;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { Course } from '../../store/useCourseStore';
|
|
3
|
+
type CourseItemProps = {
|
|
4
|
+
course: Course;
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
isInactive?: boolean;
|
|
7
|
+
onSelect: (course: Course) => void;
|
|
8
|
+
displayMode?: 'course' | 'instance' | 'instanceList';
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Course item component for displaying individual course cards.
|
|
12
|
+
*
|
|
13
|
+
* @version 2.1.0
|
|
14
|
+
* @updates
|
|
15
|
+
* - Completely redesigned with new card-based layout
|
|
16
|
+
* - Added support for inactive course states
|
|
17
|
+
* - Enhanced display modes (course/instance/instanceList)
|
|
18
|
+
* - Added transition animations and hover effects
|
|
19
|
+
* - Improved accessibility with better contrast and focus states
|
|
20
|
+
*
|
|
21
|
+
* @component
|
|
22
|
+
* @param {CourseItemProps} props
|
|
23
|
+
*/
|
|
24
|
+
declare const CourseItem: ({ course, isSelected, isInactive, onSelect, displayMode, }: CourseItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default CourseItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { Course } from '../../store/useCourseStore';
|
|
3
|
+
type CourseListProps = {
|
|
4
|
+
courses: Course[];
|
|
5
|
+
selectedCourse?: Course | null;
|
|
6
|
+
onSelectCourse: (course: Course) => void;
|
|
7
|
+
displayMode?: 'course' | 'instance' | 'instanceList';
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Course list component for displaying course collections.
|
|
11
|
+
*
|
|
12
|
+
* @version 2.1.0
|
|
13
|
+
* @updates
|
|
14
|
+
* - Added support for active/inactive course grouping
|
|
15
|
+
* - Enhanced layout with responsive grid system
|
|
16
|
+
* - Added new display mode support
|
|
17
|
+
* - Improved course filtering and sorting
|
|
18
|
+
* - Added support for course instance display
|
|
19
|
+
*
|
|
20
|
+
* @component
|
|
21
|
+
* @param {CourseListProps} props
|
|
22
|
+
*/
|
|
23
|
+
declare const CourseList: ({ courses, selectedCourse, onSelectCourse, displayMode, }: CourseListProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default CourseList;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { Course } from '../../store/useCourseStore';
|
|
3
|
+
type CourseSelectorProps = {
|
|
4
|
+
courses: Course[];
|
|
5
|
+
navigationType?: 'direct' | 'instances';
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Component for displaying and selecting courses with enhanced navigation features.
|
|
9
|
+
*
|
|
10
|
+
* @version 2.1.0
|
|
11
|
+
* @updates
|
|
12
|
+
* - Added support for direct and instance-based navigation modes
|
|
13
|
+
* - Enhanced course filtering with code and instance grouping
|
|
14
|
+
* - Added support for inactive course states
|
|
15
|
+
* - Improved course selection UI with new card-based design
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
* @param {CourseSelectorProps} props
|
|
19
|
+
* @param {Course[]} props.courses - Array of available courses
|
|
20
|
+
* @param {'direct' | 'instances'} [props.navigationType='direct'] - Navigation mode
|
|
21
|
+
*/
|
|
22
|
+
declare const CourseSelector: ({ courses, navigationType, }: CourseSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default CourseSelector;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { NavigationPageStoreItem } from '../../store/useNavigationStore';
|
|
3
|
+
interface CourseToolsProps {
|
|
4
|
+
microservices: NavigationPageStoreItem[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component for managing and displaying course-specific tools.
|
|
8
|
+
*
|
|
9
|
+
* @version 2.1.0
|
|
10
|
+
* @updates
|
|
11
|
+
* - Added support for microservice-based tool management
|
|
12
|
+
* - Introduced enabled/available tools separation
|
|
13
|
+
* - Added service enablement/disablement functionality
|
|
14
|
+
* - Enhanced teacher-specific tool configuration
|
|
15
|
+
* - Improved UI with centered headings and tool groups
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
* @param {CourseToolsProps} props
|
|
19
|
+
* @param {NavigationPageStoreItem[]} props.microservices - Array of available microservice tools
|
|
20
|
+
*/
|
|
21
|
+
declare const CourseTools: ({ microservices }: CourseToolsProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default CourseTools;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
type LayoutToggleProps = {
|
|
3
|
+
value: 'direct' | 'instances';
|
|
4
|
+
onChange: (value: 'direct' | 'instances') => void;
|
|
5
|
+
};
|
|
6
|
+
declare const LayoutToggle: ({ value, onChange }: LayoutToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default LayoutToggle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Home component with enhanced layout options.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @updates
|
|
7
|
+
* - Added layout toggle functionality
|
|
8
|
+
* - Enhanced course display modes
|
|
9
|
+
* - Improved responsive design
|
|
10
|
+
* - Added support for instance/direct navigation
|
|
11
|
+
*/
|
|
12
|
+
declare const Home: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default Home;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { NavigationPageStoreItem } from '../store/useNavigationStore';
|
|
3
|
+
export type BuildMicroServiceNavigationProps = {
|
|
4
|
+
segment: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon: any;
|
|
8
|
+
forRoles: string[];
|
|
9
|
+
children?: NavigationPageStoreItem[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Builds a navigation structure for a microservice that can be integrated into the LMS navigation system.
|
|
13
|
+
*
|
|
14
|
+
* @param {BuildMicroServiceNavigation} options - Configuration options for the microservice navigation
|
|
15
|
+
* @param {string} options.segment - URL segment for the microservice (e.g., 'edutest')
|
|
16
|
+
* @param {string} options.title - Display title of the microservice
|
|
17
|
+
* @param {string} options.description - Description of the microservice's purpose
|
|
18
|
+
* @param {any} options.icon - MUI icon component to be used for the navigation item
|
|
19
|
+
* @param {string[]} options.forRoles - Array of role names that can access this microservice
|
|
20
|
+
* @param {NavigationPageStoreItem[]} [options.children] - Optional sub-navigation items
|
|
21
|
+
*
|
|
22
|
+
* @returns {NavigationPageStoreItem[]} Array containing the navigation structure
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import ScienceIcon from '@mui/icons-material/Science';
|
|
27
|
+
*
|
|
28
|
+
* const eduTestNavigation = buildMicroServiceNavigation({
|
|
29
|
+
* segment: 'edutest',
|
|
30
|
+
* title: 'EduTest',
|
|
31
|
+
* description: 'Testing system for education',
|
|
32
|
+
* icon: ScienceIcon,
|
|
33
|
+
* forRoles: ['teacher', 'student'],
|
|
34
|
+
* children: [
|
|
35
|
+
* {
|
|
36
|
+
* kind: 'page',
|
|
37
|
+
* segment: 'assignments',
|
|
38
|
+
* title: 'Assignments',
|
|
39
|
+
* // ... other properties
|
|
40
|
+
* }
|
|
41
|
+
* ]
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const buildMicroServiceNavigation: ({ segment, title, description, icon, forRoles, children, }: BuildMicroServiceNavigationProps) => NavigationPageStoreItem[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface MicroserviceConfig {
|
|
4
|
+
path: string;
|
|
5
|
+
Component: React.ComponentType;
|
|
6
|
+
fetchHooks?: Array<(courseId: string) => void>;
|
|
7
|
+
buildNavigation: (courseId: string, isTeacher: boolean) => any[];
|
|
8
|
+
}
|
|
9
|
+
interface MicroserviceRoutesProps {
|
|
10
|
+
microservices: MicroserviceConfig[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Component responsible for managing and rendering microservice routes within the LMS.
|
|
14
|
+
*
|
|
15
|
+
* @version 2.1.0
|
|
16
|
+
* @breaking-changes
|
|
17
|
+
* - Navigation structure now requires course code and instance properties
|
|
18
|
+
* - Updated configuration interface for better TypeScript support
|
|
19
|
+
* - Changed route structure to support course instances
|
|
20
|
+
* - Added support for course code level navigation
|
|
21
|
+
* - Improved handling of microservice-specific navigation items
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @param {MicroserviceRoutesProps} props - Component properties
|
|
25
|
+
* @param {MicroserviceConfig[]} props.microservices - Array of microservice configurations
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const microservices = [{
|
|
30
|
+
* path: 'assignments',
|
|
31
|
+
* Component: AssignmentsTool,
|
|
32
|
+
* fetchHooks: [(courseId) => fetchAssignmentData(courseId)],
|
|
33
|
+
* buildNavigation: (courseId, isTeacher) => ([{
|
|
34
|
+
* kind: 'page',
|
|
35
|
+
* segment: 'assignments',
|
|
36
|
+
* title: 'Assignments',
|
|
37
|
+
* description: 'Course assignments',
|
|
38
|
+
* forRoles: ['teacher', 'student']
|
|
39
|
+
* }])
|
|
40
|
+
* }];
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare const MicroserviceRoutes: React.FC<MicroserviceRoutesProps>;
|
|
44
|
+
export default MicroserviceRoutes;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NavigationPageStoreItem } from '../store/useNavigationStore';
|
|
2
|
+
type ToolCardProps = {
|
|
3
|
+
item: NavigationPageStoreItem;
|
|
4
|
+
onToggleService?: (path: string) => void;
|
|
5
|
+
isUsed?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const ToolCard: ({ item, onToggleService, isUsed }: ToolCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ToolCard;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NavigationPageStoreItem } from '../store/useNavigationStore';
|
|
2
|
+
import { MicroserviceConfig } from './MicroserviceRoutes';
|
|
3
|
+
export type ToolDisplayerItem = {
|
|
4
|
+
path: string;
|
|
5
|
+
icon: JSX.Element;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
forRoles?: string[];
|
|
9
|
+
};
|
|
10
|
+
interface ToolDisplayerProps {
|
|
11
|
+
show: boolean;
|
|
12
|
+
title: string;
|
|
13
|
+
microservices?: MicroserviceConfig[];
|
|
14
|
+
onToggleService?: (path: string) => void;
|
|
15
|
+
navigationItems?: ToolDisplayerItem[];
|
|
16
|
+
navItems: NavigationPageStoreItem[];
|
|
17
|
+
roleCheck?: boolean;
|
|
18
|
+
isUsed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const ToolDisplayer: ({ show, onToggleService, navItems, roleCheck, isUsed, }: ToolDisplayerProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default ToolDisplayer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
export interface CourseRaw {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
code: string;
|
|
6
|
+
instance: string;
|
|
7
|
+
ltiLoginUrl?: string;
|
|
8
|
+
services?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface Course extends CourseRaw {
|
|
11
|
+
id: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Course management store with enhanced instance handling.
|
|
17
|
+
*
|
|
18
|
+
* @version 2.1.0
|
|
19
|
+
* @updates
|
|
20
|
+
* - Added support for course codes and instances
|
|
21
|
+
* - Enhanced course filtering capabilities
|
|
22
|
+
* - Added currentCourseCode state
|
|
23
|
+
* - Updated Course interface with new fields
|
|
24
|
+
* - Added instance-specific state management
|
|
25
|
+
*
|
|
26
|
+
* @breaking-changes
|
|
27
|
+
* - Updated Course interface requires code and instance fields
|
|
28
|
+
* - Changed course identification logic to use code + instance
|
|
29
|
+
*/
|
|
30
|
+
declare const useCourseStore: any;
|
|
31
|
+
export default useCourseStore;
|
|
@@ -23,6 +23,20 @@ export interface NavigationPageStoreItem extends NavigationItemBase {
|
|
|
23
23
|
metadata?: ToolMetadata;
|
|
24
24
|
}
|
|
25
25
|
export type NavigationStoreItem = NavigationHeaderItem | NavigationPageStoreItem;
|
|
26
|
+
/**
|
|
27
|
+
* Navigation management store with enhanced course instance support.
|
|
28
|
+
*
|
|
29
|
+
* @version 2.1.0
|
|
30
|
+
* @updates
|
|
31
|
+
* - Added course instance section management
|
|
32
|
+
* - Enhanced navigation structure for course instances
|
|
33
|
+
* - Added support for instance-specific tools
|
|
34
|
+
* - Improved section management with code-based identification
|
|
35
|
+
*
|
|
36
|
+
* @breaking-changes
|
|
37
|
+
* - Changed section identification from slugified title to course code
|
|
38
|
+
* - Updated navigation structure to support instance hierarchy
|
|
39
|
+
*/
|
|
26
40
|
export declare const useNavigationStore: any;
|
|
27
41
|
export declare const filterNavigationByRole: (role: string) => NavigationStoreItem[];
|
|
28
42
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { Course } from '../store/useCourseStore';
|
|
3
|
+
export declare const filterUniqueCourses: (courses: Course[]) => Course[];
|
|
4
|
+
export declare const isActiveCourse: (course: Course) => boolean;
|
|
5
|
+
export declare const isActivecode: (courses: Course[], code: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Group courses by activity status (active/inactive).
|
|
8
|
+
* @param courses List of courses or instances
|
|
9
|
+
* @param skipUnique If true, do not apply unique filtering/logic.
|
|
10
|
+
*/
|
|
11
|
+
export declare const groupCoursesByActivity: (courses: Course[], skipUnique?: boolean) => {
|
|
12
|
+
active: Course[];
|
|
13
|
+
inactive: Course[];
|
|
14
|
+
};
|