@elice/material-exercise 1.240711.1 → 1.240712.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/cjs/components/material-exercise/MaterialExercise.js +2 -1
- package/cjs/components/material-exercise/context/subjects.d.ts +4 -0
- package/cjs/components/material-exercise/context/subjects.js +5 -0
- package/cjs/components/material-exercise/context/types.d.ts +5 -0
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +11 -0
- package/es/components/material-exercise/MaterialExercise.js +3 -2
- package/es/components/material-exercise/context/subjects.d.ts +4 -0
- package/es/components/material-exercise/context/subjects.js +5 -1
- package/es/components/material-exercise/context/types.d.ts +5 -0
- package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +12 -1
- package/package.json +4 -4
|
@@ -162,7 +162,8 @@ const MaterialExercise = React.forwardRef((props, ref) => {
|
|
|
162
162
|
sendTextToRunner: text => {
|
|
163
163
|
subjects.exerciseRunnerTextSend$.next(text);
|
|
164
164
|
},
|
|
165
|
-
getMonacoEditorApis: () => exerciseMonacoEditorApis
|
|
165
|
+
getMonacoEditorApis: () => exerciseMonacoEditorApis,
|
|
166
|
+
openRunnerRooms: () => subjects.exerciseRunnerRoomsOpen$.next()
|
|
166
167
|
}), [exerciseMonacoEditorApis]);
|
|
167
168
|
//
|
|
168
169
|
//
|
|
@@ -11,3 +11,7 @@ export declare const exerciseFileEditorSaveAction$: Subject<void>;
|
|
|
11
11
|
* Send text request to runner stdio.
|
|
12
12
|
*/
|
|
13
13
|
export declare const exerciseRunnerTextSend$: Subject<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Open runner rooms.
|
|
16
|
+
*/
|
|
17
|
+
export declare const exerciseRunnerRoomsOpen$: Subject<void>;
|
|
@@ -14,7 +14,12 @@ const exerciseFileEditorSaveAction$ = new rxjs.Subject();
|
|
|
14
14
|
* Send text request to runner stdio.
|
|
15
15
|
*/
|
|
16
16
|
const exerciseRunnerTextSend$ = new rxjs.Subject();
|
|
17
|
+
/**
|
|
18
|
+
* Open runner rooms.
|
|
19
|
+
*/
|
|
20
|
+
const exerciseRunnerRoomsOpen$ = new rxjs.Subject();
|
|
17
21
|
|
|
18
22
|
exports.exerciseFileEditorContentChange$ = exerciseFileEditorContentChange$;
|
|
19
23
|
exports.exerciseFileEditorSaveAction$ = exerciseFileEditorSaveAction$;
|
|
24
|
+
exports.exerciseRunnerRoomsOpen$ = exerciseRunnerRoomsOpen$;
|
|
20
25
|
exports.exerciseRunnerTextSend$ = exerciseRunnerTextSend$;
|
|
@@ -19,6 +19,7 @@ EA extends Record<string, unknown> = {}> = MaterialExerciseCommonComponent<EP, E
|
|
|
19
19
|
export interface MaterialExerciseCommonApis {
|
|
20
20
|
sendTextToRunner: MaterialExerciseCommonApiSendTextToTerminal;
|
|
21
21
|
getMonacoEditorApis: MaterialExerciseCommonApiGetMonacoEditorApis;
|
|
22
|
+
openRunnerRooms: MaterialExerciseCommonAPiOpenRunnerRooms;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Send text to terminal.
|
|
@@ -28,6 +29,10 @@ export type MaterialExerciseCommonApiSendTextToTerminal = (text: string) => void
|
|
|
28
29
|
* Get monaco editor apis.
|
|
29
30
|
*/
|
|
30
31
|
export type MaterialExerciseCommonApiGetMonacoEditorApis = () => MonacoEditorApis | null;
|
|
32
|
+
/**
|
|
33
|
+
* Open runner rooms.
|
|
34
|
+
*/
|
|
35
|
+
export type MaterialExerciseCommonAPiOpenRunnerRooms = () => void;
|
|
31
36
|
/**
|
|
32
37
|
* [External]
|
|
33
38
|
* Common exposed props for `MaterialExercise*` components.
|
|
@@ -32,6 +32,17 @@ const ExerciseMenuDropdown = () => {
|
|
|
32
32
|
const [isCodeHistoryModalOpen, setIsCodeHistoryModalOpen] = React.useState(false);
|
|
33
33
|
const [isExerciseRoomModalOpen, setIsExerciseRoomModalOpen] = React.useState(false);
|
|
34
34
|
const isLectureTestInProgress = typeof (lecture === null || lecture === void 0 ? void 0 : lecture.testAdmissionStatus) !== 'undefined' && lecture.testAdmissionStatus === types.enums.TestAdmissionStatus.InProgress;
|
|
35
|
+
//
|
|
36
|
+
// Runner Rooms Open Subscription
|
|
37
|
+
//
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
const runnerRoomsOpenSubscription = subjects.exerciseRunnerRoomsOpen$.subscribe(() => {
|
|
40
|
+
setIsExerciseRoomModalOpen(true);
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
runnerRoomsOpenSubscription.unsubscribe();
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
35
46
|
/**
|
|
36
47
|
*
|
|
37
48
|
*/
|
|
@@ -12,7 +12,7 @@ import ExerciseFileTabsFileTreeButton from './exercise-file-tabs/exercise-file-t
|
|
|
12
12
|
import { exerciseContainerSizeState, exerciseState, exerciseFileTreeOpenedState, exercisePreviewTypeState, exercisePreviewDisplayModeState, exerciseMonacoEditorApisState } from './context/recoil.js';
|
|
13
13
|
import { ExerciseContext } from './context/context.js';
|
|
14
14
|
import { ExercisePreviewType, ExercisePreviewDisplayMode } from './context/recoilTypes.js';
|
|
15
|
-
import { exerciseRunnerTextSend$ } from './context/subjects.js';
|
|
15
|
+
import { exerciseRunnerTextSend$, exerciseRunnerRoomsOpen$ } from './context/subjects.js';
|
|
16
16
|
import ExerciseProvider from './context/ExerciseProvider.js';
|
|
17
17
|
import ExerciseFile from './exercise-file/ExerciseFile.js';
|
|
18
18
|
import './exercise-file-tabs/ExerciseFileTabs.js';
|
|
@@ -158,7 +158,8 @@ const MaterialExercise = forwardRef((props, ref) => {
|
|
|
158
158
|
sendTextToRunner: text => {
|
|
159
159
|
exerciseRunnerTextSend$.next(text);
|
|
160
160
|
},
|
|
161
|
-
getMonacoEditorApis: () => exerciseMonacoEditorApis
|
|
161
|
+
getMonacoEditorApis: () => exerciseMonacoEditorApis,
|
|
162
|
+
openRunnerRooms: () => exerciseRunnerRoomsOpen$.next()
|
|
162
163
|
}), [exerciseMonacoEditorApis]);
|
|
163
164
|
//
|
|
164
165
|
//
|
|
@@ -11,3 +11,7 @@ export declare const exerciseFileEditorSaveAction$: Subject<void>;
|
|
|
11
11
|
* Send text request to runner stdio.
|
|
12
12
|
*/
|
|
13
13
|
export declare const exerciseRunnerTextSend$: Subject<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Open runner rooms.
|
|
16
|
+
*/
|
|
17
|
+
export declare const exerciseRunnerRoomsOpen$: Subject<void>;
|
|
@@ -12,5 +12,9 @@ const exerciseFileEditorSaveAction$ = new Subject();
|
|
|
12
12
|
* Send text request to runner stdio.
|
|
13
13
|
*/
|
|
14
14
|
const exerciseRunnerTextSend$ = new Subject();
|
|
15
|
+
/**
|
|
16
|
+
* Open runner rooms.
|
|
17
|
+
*/
|
|
18
|
+
const exerciseRunnerRoomsOpen$ = new Subject();
|
|
15
19
|
|
|
16
|
-
export { exerciseFileEditorContentChange$, exerciseFileEditorSaveAction$, exerciseRunnerTextSend$ };
|
|
20
|
+
export { exerciseFileEditorContentChange$, exerciseFileEditorSaveAction$, exerciseRunnerRoomsOpen$, exerciseRunnerTextSend$ };
|
|
@@ -19,6 +19,7 @@ EA extends Record<string, unknown> = {}> = MaterialExerciseCommonComponent<EP, E
|
|
|
19
19
|
export interface MaterialExerciseCommonApis {
|
|
20
20
|
sendTextToRunner: MaterialExerciseCommonApiSendTextToTerminal;
|
|
21
21
|
getMonacoEditorApis: MaterialExerciseCommonApiGetMonacoEditorApis;
|
|
22
|
+
openRunnerRooms: MaterialExerciseCommonAPiOpenRunnerRooms;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Send text to terminal.
|
|
@@ -28,6 +29,10 @@ export type MaterialExerciseCommonApiSendTextToTerminal = (text: string) => void
|
|
|
28
29
|
* Get monaco editor apis.
|
|
29
30
|
*/
|
|
30
31
|
export type MaterialExerciseCommonApiGetMonacoEditorApis = () => MonacoEditorApis | null;
|
|
32
|
+
/**
|
|
33
|
+
* Open runner rooms.
|
|
34
|
+
*/
|
|
35
|
+
export type MaterialExerciseCommonAPiOpenRunnerRooms = () => void;
|
|
31
36
|
/**
|
|
32
37
|
* [External]
|
|
33
38
|
* Common exposed props for `MaterialExercise*` components.
|
|
@@ -8,7 +8,7 @@ import ExerciseMenuButton from '../../shared/exercise-menu-button/ExerciseMenuBu
|
|
|
8
8
|
import { exerciseUserState, exerciseState, exerciseLectureState, exerciseActiveFilenameState, exerciseRightpaneActiveState } from '../context/recoil.js';
|
|
9
9
|
import { ExerciseContext } from '../context/context.js';
|
|
10
10
|
import '../context/recoilTypes.js';
|
|
11
|
-
import { exerciseFileEditorContentChange$ } from '../context/subjects.js';
|
|
11
|
+
import { exerciseRunnerRoomsOpen$, exerciseFileEditorContentChange$ } from '../context/subjects.js';
|
|
12
12
|
import '../context/ExerciseProvider.js';
|
|
13
13
|
import ExerciseCodeHistory from '../exercise-code-history/ExerciseCodeHistory.js';
|
|
14
14
|
import ExerciseRoom from '../exercise-room/ExerciseRoom.js';
|
|
@@ -28,6 +28,17 @@ const ExerciseMenuDropdown = () => {
|
|
|
28
28
|
const [isCodeHistoryModalOpen, setIsCodeHistoryModalOpen] = React.useState(false);
|
|
29
29
|
const [isExerciseRoomModalOpen, setIsExerciseRoomModalOpen] = React.useState(false);
|
|
30
30
|
const isLectureTestInProgress = typeof (lecture === null || lecture === void 0 ? void 0 : lecture.testAdmissionStatus) !== 'undefined' && lecture.testAdmissionStatus === enums.TestAdmissionStatus.InProgress;
|
|
31
|
+
//
|
|
32
|
+
// Runner Rooms Open Subscription
|
|
33
|
+
//
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const runnerRoomsOpenSubscription = exerciseRunnerRoomsOpen$.subscribe(() => {
|
|
36
|
+
setIsExerciseRoomModalOpen(true);
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
runnerRoomsOpenSubscription.unsubscribe();
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
31
42
|
/**
|
|
32
43
|
*
|
|
33
44
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-exercise",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.240712.0",
|
|
4
4
|
"description": "User view and editing components of Elice material exercise",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@elice/icons": "^1.230814.0",
|
|
86
86
|
"@elice/intl": "0.240425.0-rc.2",
|
|
87
87
|
"@elice/markdown": "^1.220815.0",
|
|
88
|
-
"@elice/material-shared-types": "1.
|
|
89
|
-
"@elice/material-shared-utils": "1.
|
|
88
|
+
"@elice/material-shared-types": "1.240712.0",
|
|
89
|
+
"@elice/material-shared-utils": "1.240712.0",
|
|
90
90
|
"@elice/mui-elements": "^5.230825.0",
|
|
91
91
|
"@elice/mui-system": "^5.230825.0",
|
|
92
92
|
"@elice/types": "1.240709.0",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"recoil": "^0.6.1",
|
|
117
117
|
"styled-components": "^5.2.0"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "928310d29430ff8bc0a5e346fd54007ec31ee866"
|
|
120
120
|
}
|