@elice/material-runbox 1.240718.3 → 1.240719.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.
Files changed (55) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +386 -0
  2. package/cjs/assets/queue.gif.js +1 -2
  3. package/cjs/assets/runbox_logo.png.js +1 -2
  4. package/cjs/assets/terminated.png.js +1 -2
  5. package/cjs/components/material-runbox/MaterialRunbox.js +24 -20
  6. package/cjs/components/material-runbox/MaterialRunboxBody.js +10 -4
  7. package/cjs/components/material-runbox/MaterialRunboxContent.js +132 -103
  8. package/cjs/components/material-runbox/MaterialRunboxFooter.js +27 -18
  9. package/cjs/components/material-runbox/MaterialRunboxHeader.js +103 -87
  10. package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +31 -27
  11. package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +242 -159
  12. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +32 -28
  13. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +125 -76
  14. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +84 -53
  15. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +40 -28
  16. package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +27 -15
  17. package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +52 -36
  18. package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +11 -8
  19. package/cjs/components/material-runbox/contexts/index.js +17 -0
  20. package/cjs/components/material-runbox/hooks/index.js +7 -0
  21. package/cjs/components/material-runbox/hooks/useRunboxControl.js +62 -38
  22. package/cjs/components/material-runbox/index.js +7 -0
  23. package/cjs/components/material-runbox/locales/index.js +13 -0
  24. package/cjs/components/material-runbox/runtime/Runtime.js +25 -17
  25. package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +33 -29
  26. package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -39
  27. package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +72 -57
  28. package/es/_virtual/_rollupPluginBabelHelpers.js +377 -0
  29. package/es/assets/queue.gif.js +1 -2
  30. package/es/assets/runbox_logo.png.js +1 -2
  31. package/es/assets/terminated.png.js +1 -2
  32. package/es/components/material-runbox/MaterialRunbox.js +24 -20
  33. package/es/components/material-runbox/MaterialRunboxBody.js +6 -4
  34. package/es/components/material-runbox/MaterialRunboxContent.js +128 -103
  35. package/es/components/material-runbox/MaterialRunboxFooter.js +23 -18
  36. package/es/components/material-runbox/MaterialRunboxHeader.js +99 -88
  37. package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
  38. package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +237 -159
  39. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
  40. package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +121 -76
  41. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +80 -53
  42. package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +36 -28
  43. package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +22 -14
  44. package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +47 -35
  45. package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -7
  46. package/es/components/material-runbox/contexts/index.js +3 -0
  47. package/es/components/material-runbox/hooks/index.js +1 -0
  48. package/es/components/material-runbox/hooks/useRunboxControl.js +62 -38
  49. package/es/components/material-runbox/index.js +1 -0
  50. package/es/components/material-runbox/locales/index.js +4 -0
  51. package/es/components/material-runbox/runtime/Runtime.js +21 -17
  52. package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +34 -30
  53. package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +41 -40
  54. package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +69 -58
  55. package/package.json +8 -11
@@ -1,5 +1,5 @@
1
1
  import _styled from '@emotion/styled/base';
2
- import React from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
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
- const StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
13
+ var StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
14
14
  target: "e1ket70c0"
15
15
  })("production" === "production" ? {
16
16
  name: "1ep9nyp",
@@ -23,19 +23,18 @@ const StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
23
23
  //
24
24
  //
25
25
  //
26
- const MaterialRunboxActionAutoShutdown = ({
27
- runtime,
28
- runtimeTemplate,
29
- courseId,
30
- refetch
31
- }) => {
26
+ var MaterialRunboxActionAutoShutdown = function MaterialRunboxActionAutoShutdown(_ref) {
27
+ var runtime = _ref.runtime,
28
+ runtimeTemplate = _ref.runtimeTemplate,
29
+ courseId = _ref.courseId,
30
+ refetch = _ref.refetch;
32
31
  var _a;
33
- const intl = useRawEliceIntl();
34
- const materialRunboxApi = useMaterialRunboxApiContext();
32
+ var intl = useRawEliceIntl();
33
+ var materialRunboxApi = useMaterialRunboxApiContext();
35
34
  /**
36
35
  *
37
36
  */
38
- const handleAction = (_, shutdown) => {
37
+ var handleAction = function handleAction(_, shutdown) {
39
38
  if (!runtime) {
40
39
  return;
41
40
  }
@@ -45,14 +44,14 @@ const MaterialRunboxActionAutoShutdown = ({
45
44
  autoShutdown: !shutdown
46
45
  },
47
46
  eliceCourseId: courseId
48
- }).then(refetch).catch(() => {
47
+ }).then(refetch).catch(function () {
49
48
  //
50
49
  });
51
50
  };
52
51
  //
53
52
  //
54
53
  //
55
- return React.createElement(Tooltip, {
54
+ return jsx(Tooltip, {
56
55
  title: intl.formatMessage({
57
56
  id: runtimeTemplate.autoShutdown ? 'runbox.action.autoShutdown.tooltip.disabled' : 'runbox.action.autoShutdown.tooltip.enabled'
58
57
  }, {
@@ -61,22 +60,23 @@ const MaterialRunboxActionAutoShutdown = ({
61
60
  unit: 'minute',
62
61
  unitDisplay: 'short'
63
62
  })
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'
73
63
  }),
74
- componentsProps: {
75
- typography: {
76
- variant: 'body2'
64
+ children: jsx(StyledFormControlLabel, {
65
+ control: jsx(Switch, {
66
+ checked: !(runtime === null || runtime === void 0 ? void 0 : runtime.autoShutdown),
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
+ }
77
77
  }
78
- }
79
- }));
78
+ })
79
+ });
80
80
  };
81
81
 
82
82
  export { MaterialRunboxActionAutoShutdown as default };
@@ -1,4 +1,6 @@
1
+ import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import _styled from '@emotion/styled/base';
3
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
4
  import React from 'react';
3
5
  import { Transition } from 'react-transition-group';
4
6
  import { useRawEliceIntl } from '@elice/intl';
@@ -17,8 +19,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
17
19
  //
18
20
  //
19
21
  //
20
- const TRANSITION_DURATION = 300;
21
- const TRANSITION_STYLE_MAP = {
22
+ var TRANSITION_DURATION = 300;
23
+ var TRANSITION_STYLE_MAP = {
22
24
  entering: {
23
25
  maxWidth: 0
24
26
  },
@@ -38,7 +40,7 @@ const TRANSITION_STYLE_MAP = {
38
40
  //
39
41
  //
40
42
  //
41
- const StyledMainActionButton = /*#__PURE__*/_styled(LoadingButton, {
43
+ var StyledMainActionButton = /*#__PURE__*/_styled(LoadingButton, {
42
44
  target: "eae460y2"
43
45
  })("production" === "production" ? {
44
46
  name: "tssn5p",
@@ -48,139 +50,184 @@ const StyledMainActionButton = /*#__PURE__*/_styled(LoadingButton, {
48
50
  styles: "min-width:4rem!important",
49
51
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
50
52
  });
51
- const StyledSubActionButton = /*#__PURE__*/_styled(Button, {
53
+ var StyledSubActionButton = /*#__PURE__*/_styled(Button, {
52
54
  target: "eae460y1"
53
55
  })("transition:max-width ", TRANSITION_DURATION, "ms cubic-bezier(0.25, 0.46, 0.45, 1);");
54
- const StyledTerminal = /*#__PURE__*/_styled("textarea", {
56
+ var StyledTerminal = /*#__PURE__*/_styled("textarea", {
55
57
  target: "eae460y0"
56
- })("padding:1rem;width:100%;color:", ({
57
- theme
58
- }) => theme.palette.common.white, ";background-color:", ({
59
- theme
60
- }) => theme.palette.common.black, ";border:none;border-radius:0.5rem;font-family:'Elice Digital Coding',monospace;font-size:", ({
61
- theme
62
- }) => theme.typography.body2.fontSize, ";line-height:", ({
63
- theme
64
- }) => theme.typography.body2.lineHeight, ";outline:none;resize:none;");
58
+ })("padding:1rem;width:100%;color:", function (_ref) {
59
+ var theme = _ref.theme;
60
+ return theme.palette.common.white;
61
+ }, ";background-color:", function (_ref2) {
62
+ var theme = _ref2.theme;
63
+ return theme.palette.common.black;
64
+ }, ";border:none;border-radius:0.5rem;font-family:'Elice Digital Coding',monospace;font-size:", function (_ref3) {
65
+ var theme = _ref3.theme;
66
+ return theme.typography.body2.fontSize;
67
+ }, ";line-height:", function (_ref4) {
68
+ var theme = _ref4.theme;
69
+ return theme.typography.body2.lineHeight;
70
+ }, ";outline:none;resize:none;");
65
71
  //
66
72
  //
67
73
  //
68
- const MaterialRunboxActionGrade = ({
69
- runtime,
70
- courseId
71
- }) => {
74
+ var MaterialRunboxActionGrade = function MaterialRunboxActionGrade(_ref5) {
75
+ var runtime = _ref5.runtime,
76
+ courseId = _ref5.courseId;
72
77
  var _a;
73
- const intl = useRawEliceIntl();
74
- const {
75
- enqueueSnackbar
76
- } = useSnackbar();
77
- const materialRunboxApi = useMaterialRunboxApiContext();
78
- const {
79
- isLastCommandRunning,
80
- lastCommand,
81
- setCommandIdToPing
82
- } = useMaterialRunboxCommandContext();
83
- const {
84
- status
85
- } = useEliceRunboxRunning();
86
- const leaderboardSubmitInfoQuery = useQuery({
78
+ var intl = useRawEliceIntl();
79
+ var _useSnackbar = useSnackbar(),
80
+ enqueueSnackbar = _useSnackbar.enqueueSnackbar;
81
+ var materialRunboxApi = useMaterialRunboxApiContext();
82
+ var _useMaterialRunboxCom = useMaterialRunboxCommandContext(),
83
+ isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
84
+ lastCommand = _useMaterialRunboxCom.lastCommand,
85
+ setCommandIdToPing = _useMaterialRunboxCom.setCommandIdToPing;
86
+ var _useEliceRunboxRunnin = useEliceRunboxRunning(),
87
+ status = _useEliceRunboxRunnin.status;
88
+ var leaderboardSubmitInfoQuery = useQuery({
87
89
  queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
88
- courseId,
89
- runtime
90
+ courseId: courseId,
91
+ runtime: runtime
90
92
  }],
91
- queryFn: ({
92
- signal
93
- }) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
94
- eliceCourseId: courseId,
95
- runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
96
- }, {
97
- signal
98
- }),
93
+ queryFn: function queryFn(_ref6) {
94
+ var signal = _ref6.signal;
95
+ return materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
96
+ eliceCourseId: courseId,
97
+ runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
98
+ }, {
99
+ signal: signal
100
+ });
101
+ },
99
102
  enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
100
103
  retry: false
101
104
  });
102
- const isSubmitCountRemained = ((_a = leaderboardSubmitInfoQuery.data) === null || _a === void 0 ? void 0 : _a.remainSubmitCount) !== 0;
103
- const [isActionLoading, setActionLoading] = React.useState(false);
104
- const [isGradeResultDialogOpen, setGradeResultDialogOpen] = React.useState(false);
105
- const [isSubmitCountInfoDialogOpen, setSubmitCountInfoDialogOpen] = React.useState(false);
106
- const [hasUnreadResult, setHasUnreadResult] = React.useState(false);
107
- const isRunboxRunning = status === 'running';
108
- const isGradeDoneWithOutput = !isLastCommandRunning && (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade && Boolean(lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.output);
105
+ var isSubmitCountRemained = ((_a = leaderboardSubmitInfoQuery.data) === null || _a === void 0 ? void 0 : _a.remainSubmitCount) !== 0;
106
+ var _React$useState = React.useState(false),
107
+ _React$useState2 = _slicedToArray(_React$useState, 2),
108
+ isActionLoading = _React$useState2[0],
109
+ setActionLoading = _React$useState2[1];
110
+ var _React$useState3 = React.useState(false),
111
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
112
+ isGradeResultDialogOpen = _React$useState4[0],
113
+ setGradeResultDialogOpen = _React$useState4[1];
114
+ var _React$useState5 = React.useState(false),
115
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
116
+ isSubmitCountInfoDialogOpen = _React$useState6[0],
117
+ setSubmitCountInfoDialogOpen = _React$useState6[1];
118
+ var _React$useState7 = React.useState(false),
119
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
120
+ hasUnreadResult = _React$useState8[0],
121
+ setHasUnreadResult = _React$useState8[1];
122
+ var isRunboxRunning = status === 'running';
123
+ var isGradeDoneWithOutput = !isLastCommandRunning && (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade && Boolean(lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.output);
109
124
  /**
110
125
  *
111
126
  */
112
- const handleGradeResultDialogOpen = () => {
127
+ var handleGradeResultDialogOpen = function handleGradeResultDialogOpen() {
113
128
  setGradeResultDialogOpen(true);
114
129
  };
115
130
  /**
116
131
  *
117
132
  */
118
- const handleGradeResultDialogClose = () => {
133
+ var handleGradeResultDialogClose = function handleGradeResultDialogClose() {
119
134
  setGradeResultDialogOpen(false);
120
135
  };
121
136
  /**
122
137
  *
123
138
  */
124
- const handleSubmitCountInfoDialogClose = () => {
139
+ var handleSubmitCountInfoDialogClose = function handleSubmitCountInfoDialogClose() {
125
140
  setSubmitCountInfoDialogOpen(false);
126
141
  };
127
142
  /**
128
143
  *
129
144
  */
130
- const handleAction = async () => {
131
- setActionLoading(true);
132
- try {
133
- const {
134
- data: currentLeaderboardSubmitInfo
135
- } = await leaderboardSubmitInfoQuery.refetch();
136
- const isCurrentSubmitCountEmpty = (currentLeaderboardSubmitInfo === null || currentLeaderboardSubmitInfo === void 0 ? void 0 : currentLeaderboardSubmitInfo.remainSubmitCount) === 0;
137
- if (isCurrentSubmitCountEmpty) {
138
- setSubmitCountInfoDialogOpen(true);
139
- return;
140
- }
141
- const runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
142
- const {
143
- id: commandId
144
- } = await materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
145
- runtimeId,
146
- eliceCourseId: courseId,
147
- runboxCommandPostRequest: {
148
- commandType: CommandType.Grade
145
+ var handleAction = /*#__PURE__*/function () {
146
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
147
+ var _yield$leaderboardSub, currentLeaderboardSubmitInfo, isCurrentSubmitCountEmpty, runtimeId, _yield$materialRunbox, commandId;
148
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
149
+ while (1) switch (_context.prev = _context.next) {
150
+ case 0:
151
+ setActionLoading(true);
152
+ _context.prev = 1;
153
+ _context.next = 4;
154
+ return leaderboardSubmitInfoQuery.refetch();
155
+ case 4:
156
+ _yield$leaderboardSub = _context.sent;
157
+ currentLeaderboardSubmitInfo = _yield$leaderboardSub.data;
158
+ isCurrentSubmitCountEmpty = (currentLeaderboardSubmitInfo === null || currentLeaderboardSubmitInfo === void 0 ? void 0 : currentLeaderboardSubmitInfo.remainSubmitCount) === 0;
159
+ if (!isCurrentSubmitCountEmpty) {
160
+ _context.next = 10;
161
+ break;
162
+ }
163
+ setSubmitCountInfoDialogOpen(true);
164
+ return _context.abrupt("return");
165
+ case 10:
166
+ runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
167
+ _context.next = 13;
168
+ return materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
169
+ runtimeId: runtimeId,
170
+ eliceCourseId: courseId,
171
+ runboxCommandPostRequest: {
172
+ commandType: CommandType.Grade
173
+ }
174
+ });
175
+ case 13:
176
+ _yield$materialRunbox = _context.sent;
177
+ commandId = _yield$materialRunbox.id;
178
+ setCommandIdToPing(commandId);
179
+ _context.next = 21;
180
+ break;
181
+ case 18:
182
+ _context.prev = 18;
183
+ _context.t0 = _context["catch"](1);
184
+ enqueueSnackbar(intl.formatMessage({
185
+ id: 'runbox.action.grade.noti.error'
186
+ }), {
187
+ variant: 'error'
188
+ });
189
+ case 21:
190
+ _context.prev = 21;
191
+ setActionLoading(false);
192
+ return _context.finish(21);
193
+ case 24:
194
+ case "end":
195
+ return _context.stop();
149
196
  }
150
- });
151
- setCommandIdToPing(commandId);
152
- } catch (err) {
153
- enqueueSnackbar(intl.formatMessage({
154
- id: 'runbox.action.grade.noti.error'
155
- }), {
156
- variant: 'error'
157
- });
158
- } finally {
159
- setActionLoading(false);
160
- }
161
- };
197
+ }, _callee, null, [[1, 18, 21, 24]]);
198
+ }));
199
+ return function handleAction() {
200
+ return _ref7.apply(this, arguments);
201
+ };
202
+ }();
162
203
  //
163
204
  // set `hasUnreadResult` when last command output exists
164
205
  //
165
- React.useEffect(() => setHasUnreadResult(isGradeDoneWithOutput), [isGradeDoneWithOutput]);
206
+ React.useEffect(function () {
207
+ return setHasUnreadResult(isGradeDoneWithOutput);
208
+ }, [isGradeDoneWithOutput]);
166
209
  //
167
210
  // reset `hasUnreadResult` when dialog state toggled
168
211
  //
169
- React.useEffect(() => setHasUnreadResult(false), [isGradeResultDialogOpen]);
212
+ React.useEffect(function () {
213
+ return setHasUnreadResult(false);
214
+ }, [isGradeResultDialogOpen]);
170
215
  //
171
216
  // toggle dialog state when last command output exists
172
217
  //
173
- React.useEffect(() => setGradeResultDialogOpen(isGradeDoneWithOutput), [isGradeDoneWithOutput]);
218
+ React.useEffect(function () {
219
+ return setGradeResultDialogOpen(isGradeDoneWithOutput);
220
+ }, [isGradeDoneWithOutput]);
174
221
  /**
175
222
  *
176
223
  */
177
- const renderActionButton = () => {
178
- const isGradeType = (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade;
179
- const isGrading = isActionLoading || isLastCommandRunning && isGradeType;
224
+ var renderActionButton = function renderActionButton() {
225
+ var isGradeType = (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade;
226
+ var isGrading = isActionLoading || isLastCommandRunning && isGradeType;
180
227
  /**
181
228
  *
182
229
  */
183
- const getActionTooltipMessage = () => {
230
+ var getActionTooltipMessage = function getActionTooltipMessage() {
184
231
  if (!isSubmitCountRemained) {
185
232
  return intl.formatMessage({
186
233
  id: 'runbox.action.submitCountInfo.tooltip.disabled'
@@ -193,97 +240,128 @@ const MaterialRunboxActionGrade = ({
193
240
  }
194
241
  return '';
195
242
  };
196
- return React.createElement(Tooltip, {
243
+ return jsx(Tooltip, {
197
244
  title: getActionTooltipMessage(),
198
- placement: "bottom-end"
199
- }, React.createElement(ButtonGroup, {
200
- variant: "contained"
201
- }, React.createElement(StyledMainActionButton, {
202
- variant: "contained",
203
- loading: isGrading,
204
- disabled: !isRunboxRunning || isLastCommandRunning || !isSubmitCountRemained,
205
- size: "small",
206
- onClick: handleAction
207
- }, intl.formatMessage({
208
- id: 'runbox.action.grade.title'
209
- })), isGradeDoneWithOutput ? React.createElement(Transition, {
210
- in: isGradeDoneWithOutput,
211
- timeout: 0,
212
- mountOnEnter: true,
213
- unmountOnExit: true
214
- }, state => React.createElement(StyledSubActionButton, {
215
- size: "small",
216
- disabled: isLastCommandRunning,
217
- onClick: handleGradeResultDialogOpen,
218
- style: TRANSITION_STYLE_MAP[state]
219
- }, React.createElement(Badge, {
220
- color: "error",
221
- variant: "dot",
222
- invisible: !hasUnreadResult
223
- }, React.createElement(Terminal, {
224
- fontSize: "small"
225
- })))) : null));
245
+ placement: "bottom-end",
246
+ children: jsxs(ButtonGroup, {
247
+ variant: "contained",
248
+ children: [jsx(StyledMainActionButton, {
249
+ variant: "contained",
250
+ loading: isGrading,
251
+ disabled: !isRunboxRunning || isLastCommandRunning || !isSubmitCountRemained,
252
+ size: "small",
253
+ onClick: handleAction,
254
+ children: intl.formatMessage({
255
+ id: 'runbox.action.grade.title'
256
+ })
257
+ }), isGradeDoneWithOutput ? jsx(Transition, {
258
+ in: isGradeDoneWithOutput,
259
+ timeout: 0,
260
+ mountOnEnter: true,
261
+ unmountOnExit: true,
262
+ children: function children(state) {
263
+ return jsx(StyledSubActionButton, {
264
+ size: "small",
265
+ disabled: isLastCommandRunning,
266
+ onClick: handleGradeResultDialogOpen,
267
+ style: TRANSITION_STYLE_MAP[state],
268
+ children: jsx(Badge, {
269
+ color: "error",
270
+ variant: "dot",
271
+ invisible: !hasUnreadResult,
272
+ children: jsx(Terminal, {
273
+ fontSize: "small"
274
+ })
275
+ })
276
+ });
277
+ }
278
+ }) : null]
279
+ })
280
+ });
226
281
  };
227
282
  /**
228
283
  *
229
284
  */
230
- const renderActionGradeResultDialog = () => {
285
+ var renderActionGradeResultDialog = function renderActionGradeResultDialog() {
231
286
  if ((lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) !== CommandType.Grade) {
232
287
  return null;
233
288
  }
234
- return React.createElement(Dialog, {
289
+ return jsxs(Dialog, {
235
290
  open: isGradeResultDialogOpen,
236
291
  maxWidth: "md",
237
292
  fullWidth: true,
238
- onClose: handleGradeResultDialogClose
239
- }, React.createElement(DialogTitle, null, intl.formatMessage({
240
- id: 'runbox.action.grade.dialog.title'
241
- })), React.createElement(DialogContent, null, React.createElement(Stack, {
242
- gap: "0.75rem"
243
- }, lastCommand.terminatedReason === 'done' ? React.createElement(Alert, {
244
- severity: "success"
245
- }, intl.formatMessage({
246
- id: 'runbox.action.grade.dialog.description.success'
247
- })) : React.createElement(Alert, {
248
- severity: "error"
249
- }, intl.formatMessage({
250
- id: 'runbox.action.grade.dialog.description.error'
251
- })), React.createElement(StyledTerminal, {
252
- value: lastCommand.output,
253
- readOnly: true,
254
- rows: 20
255
- }))), React.createElement(DialogActions, null, React.createElement(Button, {
256
- color: "inherit",
257
- disabled: isActionLoading,
258
- onClick: handleGradeResultDialogClose
259
- }, intl.formatMessage({
260
- id: 'runbox.common.close'
261
- }))));
293
+ onClose: handleGradeResultDialogClose,
294
+ children: [jsx(DialogTitle, {
295
+ children: intl.formatMessage({
296
+ id: 'runbox.action.grade.dialog.title'
297
+ })
298
+ }), jsx(DialogContent, {
299
+ children: jsxs(Stack, {
300
+ gap: "0.75rem",
301
+ children: [lastCommand.terminatedReason === 'done' ? jsx(Alert, {
302
+ severity: "success",
303
+ children: intl.formatMessage({
304
+ id: 'runbox.action.grade.dialog.description.success'
305
+ })
306
+ }) : jsx(Alert, {
307
+ severity: "error",
308
+ children: intl.formatMessage({
309
+ id: 'runbox.action.grade.dialog.description.error'
310
+ })
311
+ }), jsx(StyledTerminal, {
312
+ value: lastCommand.output,
313
+ readOnly: true,
314
+ rows: 20
315
+ })]
316
+ })
317
+ }), jsx(DialogActions, {
318
+ children: jsx(Button, {
319
+ color: "inherit",
320
+ disabled: isActionLoading,
321
+ onClick: handleGradeResultDialogClose,
322
+ children: intl.formatMessage({
323
+ id: 'runbox.common.close'
324
+ })
325
+ })
326
+ })]
327
+ });
262
328
  };
263
329
  /**
264
330
  *
265
331
  */
266
- const renderActionSubmitCountInfoDialog = () => {
267
- return React.createElement(Dialog, {
332
+ var renderActionSubmitCountInfoDialog = function renderActionSubmitCountInfoDialog() {
333
+ return jsxs(Dialog, {
268
334
  fullWidth: true,
269
335
  maxWidth: "xs",
270
336
  open: isSubmitCountInfoDialogOpen,
271
- onClick: handleSubmitCountInfoDialogClose
272
- }, React.createElement(DialogTitle, null, intl.formatMessage({
273
- id: 'runbtox.action.submitCountInfo.dialog.title'
274
- })), React.createElement(DialogContent, null, React.createElement(Typography, null, intl.formatMessage({
275
- id: 'runbox.action.submitCountInfo.dialog.description'
276
- }))), React.createElement(DialogActions, null, React.createElement(Button, {
277
- color: "inherit",
278
- onClick: handleSubmitCountInfoDialogClose
279
- }, intl.formatMessage({
280
- id: 'runbox.common.close'
281
- }))));
337
+ onClick: handleSubmitCountInfoDialogClose,
338
+ children: [jsx(DialogTitle, {
339
+ children: intl.formatMessage({
340
+ id: 'runbtox.action.submitCountInfo.dialog.title'
341
+ })
342
+ }), jsx(DialogContent, {
343
+ children: jsx(Typography, {
344
+ children: intl.formatMessage({
345
+ id: 'runbox.action.submitCountInfo.dialog.description'
346
+ })
347
+ })
348
+ }), jsx(DialogActions, {
349
+ children: jsx(Button, {
350
+ color: "inherit",
351
+ onClick: handleSubmitCountInfoDialogClose,
352
+ children: intl.formatMessage({
353
+ id: 'runbox.common.close'
354
+ })
355
+ })
356
+ })]
357
+ });
282
358
  };
283
359
  //
284
360
  //
285
361
  //
286
- return React.createElement(React.Fragment, null, renderActionButton(), renderActionGradeResultDialog(), renderActionSubmitCountInfoDialog());
362
+ return jsxs(Fragment, {
363
+ children: [renderActionButton(), renderActionGradeResultDialog(), renderActionSubmitCountInfoDialog()]
364
+ });
287
365
  };
288
366
 
289
367
  export { MaterialRunboxActionGrade as default };