@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.2

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
@@ -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 img from '../../assets/runbox_logo.png.js';
16
+ import runboxLogoImage from '../../assets/runbox_logo.png.js';
19
17
 
20
- var StyledHeader = /*#__PURE__*/_styled("div", {
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 ", function (_ref) {
23
- var theme = _ref.theme;
24
- return theme.palette.divider;
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
- var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
30
- var runbox = _ref2.runbox,
31
- runtime = _ref2.runtime,
32
- runtimeTemplate = _ref2.runtimeTemplate,
33
- courseId = _ref2.courseId,
34
- refetch = _ref2.refetch;
35
- var intl = useRawEliceIntl();
36
- var _useMaterialRunboxCon = useMaterialRunboxContext(),
37
- enableAutoShutdownToggle = _useMaterialRunboxCon.enableAutoShutdownToggle;
38
- var _React$useState = React.useState(null),
39
- _React$useState2 = _slicedToArray(_React$useState, 2),
40
- menuAnchorEl = _React$useState2[0],
41
- setMenuAnchorEl = _React$useState2[1];
42
- var _useEliceRunboxRunnin = useEliceRunboxRunning(),
43
- status = _useEliceRunboxRunnin.status;
44
- var isRunboxRunning = status === 'running';
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
- var handleMenuClose = function handleMenuClose() {
45
+ const handleMenuClose = () => {
49
46
  setMenuAnchorEl(null);
50
47
  };
51
- var materialRunboxApi = useMaterialRunboxApiContext();
52
- var _useQuery = useQuery({
53
- queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
54
- courseId: courseId,
55
- runtime: runtime
56
- }],
57
- queryFn: function queryFn(_ref3) {
58
- var signal = _ref3.signal;
59
- return materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
60
- eliceCourseId: courseId,
61
- runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
62
- }, {
63
- signal: signal
64
- });
65
- },
66
- refetchInterval: function refetchInterval(data) {
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
- leaderboardSubmitInfo = _useQuery.data,
73
- isLeaderboardSubmitInfoLoading = _useQuery.isLoading;
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
- var renderHeaderSubmitInfo = function renderHeaderSubmitInfo() {
78
- var remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
79
- var totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
80
- var isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
81
- var isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === enums.LeaderboardEntryType.Individual;
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 jsx(Tag, {
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: 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
- var renderHeaderActionAutoShutdown = function renderHeaderActionAutoShutdown() {
96
+ const renderHeaderActionAutoShutdown = () => {
102
97
  if (!enableAutoShutdownToggle) {
103
98
  return null;
104
99
  }
105
- return jsx(MaterialRunboxActionAutoShutdown, {
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
- var renderHeaderActionGrade = function renderHeaderActionGrade() {
110
+ const renderHeaderActionGrade = () => {
116
111
  if (!runbox.submission.enabled) {
117
112
  return null;
118
113
  }
119
- return jsx(MaterialRunboxActionGrade, {
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
- var renderOptionMenu = function renderOptionMenu() {
128
- return jsxs(Fragment, {
129
- children: [jsx(IconButton, {
130
- disabled: !isRunboxRunning,
131
- onClick: function onClick(e) {
132
- if (Boolean(menuAnchorEl)) {
133
- setMenuAnchorEl(null);
134
- } else {
135
- setMenuAnchorEl(e.currentTarget);
136
- }
137
- },
138
- children: jsx(EliceIcon, {
139
- icon: faEllipsisVertical
140
- })
141
- }), jsx(MaterialRunboxActionMenu, {
142
- runbox: runbox,
143
- runtime: runtime,
144
- courseId: courseId,
145
- menuAnchorEl: menuAnchorEl,
146
- refetch: refetch,
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 jsxs(StyledHeader, {
155
- children: [jsx(Box, {
156
- component: "img",
157
- src: img,
158
- alt: "elice runbox",
159
- sx: {
160
- width: 'auto',
161
- height: '100%',
162
- imageRendering: 'auto',
163
- padding: '0.465rem 0'
164
- }
165
- }), jsxs(Stack, {
166
- direction: "row",
167
- alignItems: "center",
168
- gap: "0.5rem",
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 { jsx } from 'react/jsx-runtime';
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
- var StyledFormControlLabel = /*#__PURE__*/_styled(FormControlLabel, {
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
- var MaterialRunboxActionAutoShutdown = function MaterialRunboxActionAutoShutdown(_ref) {
27
- var runtime = _ref.runtime,
28
- runtimeTemplate = _ref.runtimeTemplate,
29
- courseId = _ref.courseId,
30
- refetch = _ref.refetch;
26
+ const MaterialRunboxActionAutoShutdown = ({
27
+ runtime,
28
+ runtimeTemplate,
29
+ courseId,
30
+ refetch
31
+ }) => {
31
32
  var _a;
32
- var intl = useRawEliceIntl();
33
- var materialRunboxApi = useMaterialRunboxApiContext();
33
+ const intl = useRawEliceIntl();
34
+ const materialRunboxApi = useMaterialRunboxApiContext();
34
35
  /**
35
36
  *
36
37
  */
37
- var handleAction = function handleAction(_, shutdown) {
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(function () {
48
+ }).then(refetch).catch(() => {
48
49
  //
49
50
  });
50
51
  };
51
52
  //
52
53
  //
53
54
  //
54
- return jsx(Tooltip, {
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
- 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
- }
74
+ componentsProps: {
75
+ typography: {
76
+ variant: 'body2'
77
77
  }
78
- })
79
- });
78
+ }
79
+ }));
80
80
  };
81
81
 
82
82
  export { MaterialRunboxActionAutoShutdown as default };