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