@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.1
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/assets/queue.gif.js +2 -1
- package/cjs/assets/runbox_logo.png.js +2 -1
- package/cjs/assets/terminated.png.js +2 -1
- package/cjs/components/material-runbox/MaterialRunbox.js +20 -24
- package/cjs/components/material-runbox/MaterialRunboxBody.js +4 -10
- package/cjs/components/material-runbox/MaterialRunboxContent.js +103 -132
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +18 -27
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +87 -103
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -31
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -242
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -32
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -125
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -84
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -40
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +15 -27
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +36 -52
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +8 -11
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/cjs/components/material-runbox/runtime/Runtime.js +17 -25
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +29 -33
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +39 -40
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -72
- package/es/assets/queue.gif.js +2 -1
- package/es/assets/runbox_logo.png.js +2 -1
- package/es/assets/terminated.png.js +2 -1
- package/es/components/material-runbox/MaterialRunbox.js +20 -24
- package/es/components/material-runbox/MaterialRunboxBody.js +4 -6
- package/es/components/material-runbox/MaterialRunboxContent.js +103 -128
- package/es/components/material-runbox/MaterialRunboxFooter.js +18 -23
- package/es/components/material-runbox/MaterialRunboxHeader.js +88 -99
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -237
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -121
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -80
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -36
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +14 -22
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -47
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +7 -6
- package/es/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/es/components/material-runbox/runtime/Runtime.js +17 -21
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +30 -34
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -41
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -69
- package/package.json +11 -8
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -386
- package/cjs/components/material-runbox/contexts/index.js +0 -17
- package/cjs/components/material-runbox/hooks/index.js +0 -7
- package/cjs/components/material-runbox/index.js +0 -7
- package/cjs/components/material-runbox/locales/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -377
- package/es/components/material-runbox/contexts/index.js +0 -3
- package/es/components/material-runbox/hooks/index.js +0 -1
- package/es/components/material-runbox/index.js +0 -1
- package/es/components/material-runbox/locales/index.js +0 -4
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import _styled from '@emotion/styled/base';
|
|
3
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import { useRawEliceIntl } from '@elice/intl';
|
|
6
4
|
import { Tag, EliceIcon } from '@elice/mui-elements';
|
|
@@ -15,80 +13,77 @@ import MaterialRunboxActionMenu from './actions/MaterialRunboxActionMenu.js';
|
|
|
15
13
|
import { useMaterialRunboxApiContext } from './contexts/MaterialRunboxApiContext.js';
|
|
16
14
|
import './contexts/MaterialRunboxCommandContext.js';
|
|
17
15
|
import { useMaterialRunboxContext } from './contexts/MaterialRunboxContext.js';
|
|
18
|
-
import
|
|
16
|
+
import runboxLogoImage from '../../assets/runbox_logo.png.js';
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
const StyledHeader = /*#__PURE__*/_styled("div", {
|
|
21
19
|
target: "e110d0bp0"
|
|
22
|
-
})("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ",
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, ";overflow:hidden;");
|
|
20
|
+
})("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", ({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.palette.divider, ";overflow:hidden;");
|
|
26
23
|
//
|
|
27
24
|
//
|
|
28
25
|
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
const MaterialRunboxHeader = ({
|
|
27
|
+
runbox,
|
|
28
|
+
runtime,
|
|
29
|
+
runtimeTemplate,
|
|
30
|
+
courseId,
|
|
31
|
+
refetch
|
|
32
|
+
}) => {
|
|
33
|
+
const intl = useRawEliceIntl();
|
|
34
|
+
const {
|
|
35
|
+
enableAutoShutdownToggle
|
|
36
|
+
} = useMaterialRunboxContext();
|
|
37
|
+
const [menuAnchorEl, setMenuAnchorEl] = React.useState(null);
|
|
38
|
+
const {
|
|
39
|
+
status
|
|
40
|
+
} = useEliceRunboxRunning();
|
|
41
|
+
const isRunboxRunning = status === 'running';
|
|
45
42
|
/**
|
|
46
43
|
*
|
|
47
44
|
*/
|
|
48
|
-
|
|
45
|
+
const handleMenuClose = () => {
|
|
49
46
|
setMenuAnchorEl(null);
|
|
50
47
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000;
|
|
68
|
-
},
|
|
69
|
-
enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
|
|
70
|
-
retry: false
|
|
48
|
+
const materialRunboxApi = useMaterialRunboxApiContext();
|
|
49
|
+
const {
|
|
50
|
+
data: leaderboardSubmitInfo,
|
|
51
|
+
isLoading: isLeaderboardSubmitInfoLoading
|
|
52
|
+
} = useQuery({
|
|
53
|
+
queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
|
|
54
|
+
courseId,
|
|
55
|
+
runtime
|
|
56
|
+
}],
|
|
57
|
+
queryFn: ({
|
|
58
|
+
signal
|
|
59
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
|
|
60
|
+
eliceCourseId: courseId,
|
|
61
|
+
runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
|
|
62
|
+
}, {
|
|
63
|
+
signal
|
|
71
64
|
}),
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
refetchInterval: data => !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000,
|
|
66
|
+
enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
|
|
67
|
+
retry: false
|
|
68
|
+
});
|
|
74
69
|
/**
|
|
75
70
|
*
|
|
76
71
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
const renderHeaderSubmitInfo = () => {
|
|
73
|
+
const remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
|
|
74
|
+
const totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
|
|
75
|
+
const isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
|
|
76
|
+
const isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === enums.LeaderboardEntryType.Individual;
|
|
82
77
|
if (isLeaderboardSubmitInfoLoading || remainSubmitCount === null) {
|
|
83
78
|
return null;
|
|
84
79
|
}
|
|
85
|
-
return
|
|
80
|
+
return React.createElement(Tag, {
|
|
86
81
|
label: intl.formatMessage({
|
|
87
82
|
id: 'runbox.header.submitInfo'
|
|
88
83
|
}, {
|
|
89
84
|
remainCount: remainSubmitCount,
|
|
90
85
|
totalCount: totalSubmitCount,
|
|
91
|
-
isDailyLimitEnabled
|
|
86
|
+
isDailyLimitEnabled,
|
|
92
87
|
isIndividual: isIndividualTypeLeaderboard
|
|
93
88
|
}),
|
|
94
89
|
variant: "muted",
|
|
@@ -98,11 +93,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
98
93
|
/**
|
|
99
94
|
*
|
|
100
95
|
*/
|
|
101
|
-
|
|
96
|
+
const renderHeaderActionAutoShutdown = () => {
|
|
102
97
|
if (!enableAutoShutdownToggle) {
|
|
103
98
|
return null;
|
|
104
99
|
}
|
|
105
|
-
return
|
|
100
|
+
return React.createElement(MaterialRunboxActionAutoShutdown, {
|
|
106
101
|
runtime: runtime,
|
|
107
102
|
runtimeTemplate: runtimeTemplate,
|
|
108
103
|
courseId: courseId,
|
|
@@ -112,11 +107,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
112
107
|
/**
|
|
113
108
|
*
|
|
114
109
|
*/
|
|
115
|
-
|
|
110
|
+
const renderHeaderActionGrade = () => {
|
|
116
111
|
if (!runbox.submission.enabled) {
|
|
117
112
|
return null;
|
|
118
113
|
}
|
|
119
|
-
return
|
|
114
|
+
return React.createElement(MaterialRunboxActionGrade, {
|
|
120
115
|
runtime: runtime,
|
|
121
116
|
courseId: courseId
|
|
122
117
|
});
|
|
@@ -124,51 +119,45 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
124
119
|
/**
|
|
125
120
|
*
|
|
126
121
|
*/
|
|
127
|
-
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
handleMenuClose: handleMenuClose
|
|
148
|
-
})]
|
|
149
|
-
});
|
|
122
|
+
const renderOptionMenu = () => {
|
|
123
|
+
return React.createElement(React.Fragment, null, React.createElement(IconButton, {
|
|
124
|
+
disabled: !isRunboxRunning,
|
|
125
|
+
onClick: e => {
|
|
126
|
+
if (Boolean(menuAnchorEl)) {
|
|
127
|
+
setMenuAnchorEl(null);
|
|
128
|
+
} else {
|
|
129
|
+
setMenuAnchorEl(e.currentTarget);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, React.createElement(EliceIcon, {
|
|
133
|
+
icon: faEllipsisVertical
|
|
134
|
+
})), React.createElement(MaterialRunboxActionMenu, {
|
|
135
|
+
runbox: runbox,
|
|
136
|
+
runtime: runtime,
|
|
137
|
+
courseId: courseId,
|
|
138
|
+
menuAnchorEl: menuAnchorEl,
|
|
139
|
+
refetch: refetch,
|
|
140
|
+
handleMenuClose: handleMenuClose
|
|
141
|
+
}));
|
|
150
142
|
};
|
|
151
143
|
//
|
|
152
144
|
//
|
|
153
145
|
//
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
children: [renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()]
|
|
170
|
-
})]
|
|
171
|
-
});
|
|
146
|
+
return React.createElement(StyledHeader, null, React.createElement(Box, {
|
|
147
|
+
component: "img",
|
|
148
|
+
src: runboxLogoImage,
|
|
149
|
+
alt: "elice runbox",
|
|
150
|
+
sx: {
|
|
151
|
+
width: 'auto',
|
|
152
|
+
height: '100%',
|
|
153
|
+
imageRendering: 'auto',
|
|
154
|
+
padding: '0.465rem 0'
|
|
155
|
+
}
|
|
156
|
+
}), React.createElement(Stack, {
|
|
157
|
+
direction: "row",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
gap: "0.5rem"
|
|
160
|
+
}, renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()));
|
|
172
161
|
};
|
|
173
162
|
|
|
174
163
|
export { MaterialRunboxHeader as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _styled from '@emotion/styled/base';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { useRawEliceIntl } from '@elice/intl';
|
|
4
4
|
import { FormControlLabel, Tooltip, Switch } from '@mui/material';
|
|
5
5
|
import { useMaterialRunboxApiContext } from '../contexts/MaterialRunboxApiContext.js';
|
|
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
//
|
|
11
11
|
//
|
|
12
12
|
//
|
|
13
|
-
|
|
13
|
+
const StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
|
|
14
14
|
target: "e1ket70c0"
|
|
15
15
|
})("production" === "production" ? {
|
|
16
16
|
name: "1ep9nyp",
|
|
@@ -23,18 +23,19 @@ var StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
|
|
|
23
23
|
//
|
|
24
24
|
//
|
|
25
25
|
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const MaterialRunboxActionAutoShutdown = ({
|
|
27
|
+
runtime,
|
|
28
|
+
runtimeTemplate,
|
|
29
|
+
courseId,
|
|
30
|
+
refetch
|
|
31
|
+
}) => {
|
|
31
32
|
var _a;
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const intl = useRawEliceIntl();
|
|
34
|
+
const materialRunboxApi = useMaterialRunboxApiContext();
|
|
34
35
|
/**
|
|
35
36
|
*
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
const handleAction = (_, shutdown) => {
|
|
38
39
|
if (!runtime) {
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
@@ -44,14 +45,14 @@ var MaterialRunboxActionAutoShutdown = function MaterialRunboxActionAutoShutdown
|
|
|
44
45
|
autoShutdown: !shutdown
|
|
45
46
|
},
|
|
46
47
|
eliceCourseId: courseId
|
|
47
|
-
}).then(refetch).catch(
|
|
48
|
+
}).then(refetch).catch(() => {
|
|
48
49
|
//
|
|
49
50
|
});
|
|
50
51
|
};
|
|
51
52
|
//
|
|
52
53
|
//
|
|
53
54
|
//
|
|
54
|
-
return
|
|
55
|
+
return React.createElement(Tooltip, {
|
|
55
56
|
title: intl.formatMessage({
|
|
56
57
|
id: runtimeTemplate.autoShutdown ? 'runbox.action.autoShutdown.tooltip.disabled' : 'runbox.action.autoShutdown.tooltip.enabled'
|
|
57
58
|
}, {
|
|
@@ -60,23 +61,22 @@ var MaterialRunboxActionAutoShutdown = function MaterialRunboxActionAutoShutdown
|
|
|
60
61
|
unit: 'minute',
|
|
61
62
|
unitDisplay: 'short'
|
|
62
63
|
})
|
|
64
|
+
})
|
|
65
|
+
}, React.createElement(StyledFormControlLabel, {
|
|
66
|
+
control: React.createElement(Switch, {
|
|
67
|
+
checked: !(runtime === null || runtime === void 0 ? void 0 : runtime.autoShutdown),
|
|
68
|
+
disabled: !runtime || runtimeTemplate.autoShutdown,
|
|
69
|
+
onChange: handleAction
|
|
70
|
+
}),
|
|
71
|
+
label: intl.formatMessage({
|
|
72
|
+
id: 'runbox.action.autoShutdown.title'
|
|
63
73
|
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
disabled: !runtime || runtimeTemplate.autoShutdown,
|
|
68
|
-
onChange: handleAction
|
|
69
|
-
}),
|
|
70
|
-
label: intl.formatMessage({
|
|
71
|
-
id: 'runbox.action.autoShutdown.title'
|
|
72
|
-
}),
|
|
73
|
-
componentsProps: {
|
|
74
|
-
typography: {
|
|
75
|
-
variant: 'body2'
|
|
76
|
-
}
|
|
74
|
+
componentsProps: {
|
|
75
|
+
typography: {
|
|
76
|
+
variant: 'body2'
|
|
77
77
|
}
|
|
78
|
-
}
|
|
79
|
-
});
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
export { MaterialRunboxActionAutoShutdown as default };
|