@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
@@ -2,54 +2,42 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var jsxRuntime = require('react/jsx-runtime');
7
5
  var React = require('react');
8
6
  var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
9
7
 
10
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
-
12
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
-
14
8
  //
15
9
  //
16
10
  //
17
- var MaterialRunboxApiContext = React__default.default.createContext({});
18
- var useMaterialRunboxApiContext = function useMaterialRunboxApiContext() {
19
- return React__default.default.useContext(MaterialRunboxApiContext);
11
+ const MaterialRunboxApiContext = React.createContext({});
12
+ const useMaterialRunboxApiContext = () => {
13
+ return React.useContext(MaterialRunboxApiContext);
20
14
  };
21
15
  //
22
16
  //
23
17
  //
24
- var MaterialRunboxApiContextProvider = function MaterialRunboxApiContextProvider(_ref) {
25
- var children = _ref.children,
26
- eliceMaterialRunboxApiConfiguration = _ref.eliceMaterialRunboxApiConfiguration;
27
- var createMaterialRunboxApi = function createMaterialRunboxApi() {
28
- return Object.freeze({
29
- runbox: new openapiClientMaterialRunbox.RunboxApi(eliceMaterialRunboxApiConfiguration),
30
- runtime: new openapiClientMaterialRunbox.RuntimeApi(eliceMaterialRunboxApiConfiguration),
31
- runtimeTemplate: new openapiClientMaterialRunbox.RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
32
- });
33
- };
18
+ const MaterialRunboxApiContextProvider = ({
19
+ children,
20
+ eliceMaterialRunboxApiConfiguration
21
+ }) => {
22
+ const createMaterialRunboxApi = () => Object.freeze({
23
+ runbox: new openapiClientMaterialRunbox.RunboxApi(eliceMaterialRunboxApiConfiguration),
24
+ runtime: new openapiClientMaterialRunbox.RuntimeApi(eliceMaterialRunboxApiConfiguration),
25
+ runtimeTemplate: new openapiClientMaterialRunbox.RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
26
+ });
34
27
  //
35
28
  //
36
29
  //
37
- var _React$useState = React__default.default.useState(createMaterialRunboxApi),
38
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
39
- materialRunboxApi = _React$useState2[0],
40
- setMaterialRunboxApi = _React$useState2[1];
30
+ const [materialRunboxApi, setMaterialRunboxApi] = React.useState(createMaterialRunboxApi);
41
31
  //
42
32
  //
43
33
  //
44
- React__default.default.useEffect(function () {
45
- return setMaterialRunboxApi(createMaterialRunboxApi);
46
- },
34
+ React.useEffect(() => setMaterialRunboxApi(createMaterialRunboxApi),
47
35
  // eslint-disable-next-line react-hooks/exhaustive-deps
48
36
  [eliceMaterialRunboxApiConfiguration]);
49
37
  //
50
38
  //
51
39
  //
52
- return jsxRuntime.jsx(MaterialRunboxApiContext.Provider, {
40
+ return React.createElement(MaterialRunboxApiContext.Provider, {
53
41
  children: children,
54
42
  value: materialRunboxApi
55
43
  });
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var jsxRuntime = require('react/jsx-runtime');
7
5
  var React = require('react');
8
6
  var intl = require('@elice/intl');
9
7
  var muiXSnackbar = require('@elice/mui-x-snackbar');
@@ -12,95 +10,81 @@ var rxjs = require('rxjs');
12
10
  var operators = require('rxjs/operators');
13
11
  var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
14
12
 
15
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
16
-
17
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
18
-
19
13
  //
20
14
  //
21
15
  //
22
- var PING_INTERVAL = 2000;
23
- var PING_MAX_TRY_SECOND = 3 * 60; // 3min (ref: https://teams.microsoft.com/l/message/19:aa082e4a9f6f456fbea872be532123d4@thread.tacv2/1689228421341?tenantId=5bb6f1f4-0b48-4496-9baf-f9fb7da5d352&groupId=27480e72-5fcb-4ac9-b4e7-5b92abb31a95&parentMessageId=1689217573531&teamName=div-CTO&channelName=issue-report&createdTime=1689228421341&allowXTenantAccess=false)
24
- var PING_MAX_TRY_COUNT = PING_MAX_TRY_SECOND * 1000 / PING_INTERVAL;
16
+ const PING_INTERVAL = 2000;
17
+ const PING_MAX_TRY_SECOND = 3 * 60; // 3min (ref: https://teams.microsoft.com/l/message/19:aa082e4a9f6f456fbea872be532123d4@thread.tacv2/1689228421341?tenantId=5bb6f1f4-0b48-4496-9baf-f9fb7da5d352&groupId=27480e72-5fcb-4ac9-b4e7-5b92abb31a95&parentMessageId=1689217573531&teamName=div-CTO&channelName=issue-report&createdTime=1689228421341&allowXTenantAccess=false)
18
+ const PING_MAX_TRY_COUNT = PING_MAX_TRY_SECOND * 1000 / PING_INTERVAL;
25
19
  //
26
20
  //
27
21
  //
28
- var MaterialRunboxCommandContext = React__default.default.createContext({});
29
- var useMaterialRunboxCommandContext = function useMaterialRunboxCommandContext() {
30
- return React__default.default.useContext(MaterialRunboxCommandContext);
22
+ const MaterialRunboxCommandContext = React.createContext({});
23
+ const useMaterialRunboxCommandContext = () => {
24
+ return React.useContext(MaterialRunboxCommandContext);
31
25
  };
32
26
  //
33
27
  //
34
28
  //
35
- var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContextProvider(_ref) {
36
- var children = _ref.children,
37
- runtime = _ref.runtime,
38
- courseId = _ref.courseId;
39
- var intl$1 = intl.useRawEliceIntl();
40
- var _useSnackbar = muiXSnackbar.useSnackbar(),
41
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
42
- var runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
43
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
44
- var _React$useState = React__default.default.useState(null),
45
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
46
- pcmdId = _React$useState2[0],
47
- setPcmdId = _React$useState2[1]; // Ping Command ID
48
- var _React$useState3 = React__default.default.useState(null),
49
- _React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
50
- lastCommand = _React$useState4[0],
51
- setLastCommand = _React$useState4[1];
29
+ const MaterialRunboxCommandContextProvider = ({
30
+ children,
31
+ runtime,
32
+ courseId
33
+ }) => {
34
+ const intl$1 = intl.useRawEliceIntl();
35
+ const {
36
+ enqueueSnackbar
37
+ } = muiXSnackbar.useSnackbar();
38
+ const runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
39
+ const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
40
+ const [pcmdId, setPcmdId] = React.useState(null); // Ping Command ID
41
+ const [lastCommand, setLastCommand] = React.useState(null);
52
42
  //
53
43
  // check whether running command exists or not on mount,
54
44
  // if running command exists, set `pcmdId` to start pinging
55
45
  //
56
- React__default.default.useEffect(function () {
46
+ React.useEffect(() => {
57
47
  if (!runtimeId) {
58
48
  return;
59
49
  }
60
50
  materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
61
- runtimeId: runtimeId,
51
+ runtimeId,
62
52
  eliceCourseId: courseId
63
- }).then(function (res) {
53
+ }).then(res => {
64
54
  if (res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated) {
65
55
  setLastCommand(res);
66
56
  setPcmdId(res.runboxCommandId);
67
57
  }
68
- }).catch(function () {
69
- return void 0;
70
- });
58
+ }).catch(() => void 0);
71
59
  },
72
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
73
61
  [runtimeId, courseId]);
74
62
  //
75
63
  // ping command
76
64
  //
77
- React__default.default.useEffect(function () {
65
+ React.useEffect(() => {
78
66
  if (!pcmdId || !runtimeId) {
79
67
  return;
80
68
  }
81
- var _pingobj = {};
82
- var subscription = rxjs.timer(0, PING_INTERVAL).pipe(operators.take(PING_MAX_TRY_COUNT), operators.switchMap(function () {
83
- return materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
84
- runtimeId: runtimeId,
85
- eliceCourseId: courseId
86
- });
87
- }), operators.takeWhile(function (res) {
88
- return res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
89
- }, true)).subscribe({
90
- next: function next(res) {
69
+ const _pingobj = {};
70
+ const subscription = rxjs.timer(0, PING_INTERVAL).pipe(operators.take(PING_MAX_TRY_COUNT), operators.switchMap(() => materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
71
+ runtimeId,
72
+ eliceCourseId: courseId
73
+ })), operators.takeWhile(res => res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated, true)).subscribe({
74
+ next: res => {
91
75
  _pingobj.res = res;
92
76
  setLastCommand(res);
93
77
  },
94
- error: function error() {
78
+ error: () => {
95
79
  enqueueSnackbar(intl$1.formatMessage({
96
80
  id: 'runbox.context.command.ping.error'
97
81
  }), {
98
82
  variant: 'error'
99
83
  });
100
84
  },
101
- complete: function complete() {
85
+ complete: () => {
102
86
  setPcmdId(null); // empty `pcmdId` to stop pinging
103
- var hasError = !_pingobj.res ||
87
+ const hasError = !_pingobj.res ||
104
88
  // max try count reached, but command is still running
105
89
  _pingobj.res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
106
90
  if (hasError) {
@@ -113,7 +97,7 @@ var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContext
113
97
  }
114
98
  }
115
99
  });
116
- return function () {
100
+ return () => {
117
101
  subscription.unsubscribe();
118
102
  };
119
103
  },
@@ -122,10 +106,10 @@ var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContext
122
106
  //
123
107
  //
124
108
  //
125
- return jsxRuntime.jsx(MaterialRunboxCommandContext.Provider, {
109
+ return React.createElement(MaterialRunboxCommandContext.Provider, {
126
110
  children: children,
127
111
  value: {
128
- lastCommand: lastCommand,
112
+ lastCommand,
129
113
  isLastCommandRunning: Boolean((lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === openapiClientMaterialRunbox.CommandStatus.Queued || (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === openapiClientMaterialRunbox.CommandStatus.Started),
130
114
  setCommandIdToPing: setPcmdId
131
115
  }
@@ -3,27 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
- var jsxRuntime = require('react/jsx-runtime');
7
6
  var React = require('react');
8
7
 
9
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
10
-
11
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
12
-
13
8
  //
14
9
  //
15
10
  //
16
- var MaterialRunboxContext = React__default.default.createContext({});
17
- var useMaterialRunboxContext = function useMaterialRunboxContext() {
18
- return React__default.default.useContext(MaterialRunboxContext);
11
+ const MaterialRunboxContext = React.createContext({});
12
+ const useMaterialRunboxContext = () => {
13
+ return React.useContext(MaterialRunboxContext);
19
14
  };
20
15
  //
21
16
  //
22
17
  //
23
- var MaterialRunboxContextProvider = function MaterialRunboxContextProvider(_a) {
24
- var children = _a.children,
18
+ const MaterialRunboxContextProvider = _a => {
19
+ var {
20
+ children
21
+ } = _a,
25
22
  props = tslib.__rest(_a, ["children"]);
26
- return jsxRuntime.jsx(MaterialRunboxContext.Provider, {
23
+ return React.createElement(MaterialRunboxContext.Provider, {
27
24
  children: children,
28
25
  value: props
29
26
  });
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
4
3
  var React = require('react');
5
4
  var intl = require('@elice/intl');
6
5
  var muiXSnackbar = require('@elice/mui-x-snackbar');
@@ -15,76 +14,53 @@ require('../contexts/MaterialRunboxContext.js');
15
14
  /**
16
15
  * Hook for runbox control and status.
17
16
  */
18
- var useRunboxControl = function useRunboxControl(props) {
19
- var _return = React.useRef({});
20
- var intl$1 = intl.useRawEliceIntl();
21
- var _useSnackbar = muiXSnackbar.useSnackbar(),
22
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
23
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
24
- var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
25
- runboxStart = _useEliceRunboxRunnin.start,
26
- runboxStop = _useEliceRunboxRunnin.stop;
17
+ const useRunboxControl = props => {
18
+ const _return = React.useRef({});
19
+ const intl$1 = intl.useRawEliceIntl();
20
+ const {
21
+ enqueueSnackbar
22
+ } = muiXSnackbar.useSnackbar();
23
+ const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
24
+ const {
25
+ start: runboxStart,
26
+ stop: runboxStop
27
+ } = runboxClient.useEliceRunboxRunning();
27
28
  /**
28
29
  * Start project.
29
30
  */
30
- var start = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
31
- var force,
32
- _args = arguments;
33
- return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
34
- while (1) switch (_context.prev = _context.next) {
35
- case 0:
36
- force = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
37
- return _context.abrupt("return", runboxStart(function (signal) {
38
- return materialRunboxApi.runbox.runboxRunboxIdStartPost({
39
- runboxId: props.runbox.id,
40
- eliceCourseId: props.courseId
41
- }, {
42
- signal: signal
43
- });
44
- }, force).then(function () {
45
- return void props.refetch();
46
- }).catch(function (err) {
47
- if (err.name !== 'AbortError') {
48
- enqueueSnackbar(intl$1.formatMessage({
49
- id: 'runbox.runtime.message.startError'
50
- }), {
51
- variant: 'error'
52
- });
53
- }
54
- }));
55
- case 2:
56
- case "end":
57
- return _context.stop();
31
+ const start = React.useCallback(async (force = false) => {
32
+ return runboxStart(signal => materialRunboxApi.runbox.runboxRunboxIdStartPost({
33
+ runboxId: props.runbox.id,
34
+ eliceCourseId: props.courseId
35
+ }, {
36
+ signal
37
+ }), force).then(() => void props.refetch()).catch(err => {
38
+ if (err.name !== 'AbortError') {
39
+ enqueueSnackbar(intl$1.formatMessage({
40
+ id: 'runbox.runtime.message.startError'
41
+ }), {
42
+ variant: 'error'
43
+ });
58
44
  }
59
- }, _callee);
60
- })),
45
+ });
46
+ },
61
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
62
48
  [props.runbox.id, props.courseId, runboxStart]);
63
49
  /**
64
50
  * Stop project.
65
51
  */
66
- var stop = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee2() {
67
- return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee2$(_context2) {
68
- while (1) switch (_context2.prev = _context2.next) {
69
- case 0:
70
- return _context2.abrupt("return", runboxStop(function (signal) {
71
- return materialRunboxApi.runbox.runboxRunboxIdStopPost({
72
- runboxId: props.runbox.id,
73
- eliceCourseId: props.courseId
74
- }, {
75
- signal: signal
76
- });
77
- }).then(function () {
78
- //
79
- }).catch(function (err) {
80
- if (err.name !== 'AbortError') ;
81
- }));
82
- case 1:
83
- case "end":
84
- return _context2.stop();
85
- }
86
- }, _callee2);
87
- })),
52
+ const stop = React.useCallback(async () => {
53
+ return runboxStop(signal => materialRunboxApi.runbox.runboxRunboxIdStopPost({
54
+ runboxId: props.runbox.id,
55
+ eliceCourseId: props.courseId
56
+ }, {
57
+ signal
58
+ })).then(() => {
59
+ //
60
+ }).catch(err => {
61
+ if (err.name !== 'AbortError') ;
62
+ });
63
+ },
88
64
  // eslint-disable-next-line react-hooks/exhaustive-deps
89
65
  [props.runbox.id, props.courseId, runboxStop]);
90
66
  //
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var jsxRuntime = require('react/jsx-runtime');
7
5
  var React = require('react');
8
6
  var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
9
7
  var runboxClient = require('@elice/runbox-client');
@@ -15,27 +13,22 @@ var RuntimeOverlayAssigned = require('./RuntimeOverlayAssigned.js');
15
13
  var RuntimeOverlayQueued = require('./RuntimeOverlayQueued.js');
16
14
  var RuntimeOverlayTerminated = require('./RuntimeOverlayTerminated.js');
17
15
 
18
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
19
-
20
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
-
22
16
  //
23
17
  //
24
18
  //
25
- var Runtime = function Runtime(props) {
26
- var _useMaterialRunboxCom = MaterialRunboxCommandContext.useMaterialRunboxCommandContext(),
27
- isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
28
- lastCommand = _useMaterialRunboxCom.lastCommand;
29
- var _useRunboxControl = useRunboxControl.useRunboxControl(props),
30
- startRuntime = _useRunboxControl.start;
31
- var _React$useState = React__default.default.useState(0),
32
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
33
- viewRefreshTrigger = _React$useState2[0],
34
- setViewRefreshTrigger = _React$useState2[1];
19
+ const Runtime = props => {
20
+ const {
21
+ isLastCommandRunning,
22
+ lastCommand
23
+ } = MaterialRunboxCommandContext.useMaterialRunboxCommandContext();
24
+ const {
25
+ start: startRuntime
26
+ } = useRunboxControl.useRunboxControl(props);
27
+ const [viewRefreshTrigger, setViewRefreshTrigger] = React.useState(0);
35
28
  //
36
29
  //
37
30
  //
38
- React__default.default.useEffect(function () {
31
+ React.useEffect(() => {
39
32
  if (!props.runbox.id) {
40
33
  return;
41
34
  }
@@ -56,7 +49,7 @@ var Runtime = function Runtime(props) {
56
49
  //
57
50
  // refresh view when `ProjectFileReset` command done.
58
51
  //
59
- React__default.default.useEffect(function () {
52
+ React.useEffect(() => {
60
53
  if (isLastCommandRunning || !lastCommand) {
61
54
  return;
62
55
  }
@@ -72,15 +65,14 @@ var Runtime = function Runtime(props) {
72
65
  //
73
66
  //
74
67
  //
75
- return jsxRuntime.jsx(runboxClient.EliceRunboxView, {
68
+ return React.createElement(runboxClient.EliceRunboxView, {
69
+ key: viewRefreshTrigger,
76
70
  OverlayAssigned: RuntimeOverlayAssigned.default,
77
71
  OverlayQueued: RuntimeOverlayQueued.default,
78
- OverlayTerminated: function OverlayTerminated(props) {
79
- return jsxRuntime.jsx(RuntimeOverlayTerminated.default, Object.assign({}, props, {
80
- startRuntime: startRuntime
81
- }));
82
- }
83
- }, viewRefreshTrigger);
72
+ OverlayTerminated: props => React.createElement(RuntimeOverlayTerminated.default, Object.assign({}, props, {
73
+ startRuntime: startRuntime
74
+ }))
75
+ });
84
76
  };
85
77
 
86
78
  exports.default = Runtime;
@@ -2,8 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
7
6
  var reactUse = require('react-use');
8
7
  var intl = require('@elice/intl');
9
8
  var material = require('@mui/material');
@@ -14,19 +13,18 @@ var queue = require('../../../assets/queue.gif.js');
14
13
  //
15
14
  //
16
15
  //
17
- var ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
16
+ const ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
18
17
  //
19
18
  //
20
19
  //
21
- var RuntimeOverlayAssigned = function RuntimeOverlayAssigned(_ref) {
22
- var intl = _ref.__intl;
23
- var _useTimeout = reactUse.useTimeout(ASSIGNED_NORMAL_TIMEOUT),
24
- _useTimeout2 = _rollupPluginBabelHelpers.slicedToArray(_useTimeout, 1),
25
- timeout = _useTimeout2[0];
20
+ const RuntimeOverlayAssigned = ({
21
+ __intl: intl
22
+ }) => {
23
+ const [timeout] = reactUse.useTimeout(ASSIGNED_NORMAL_TIMEOUT);
26
24
  //
27
25
  //
28
26
  //
29
- return jsxRuntime.jsxs(material.Stack, {
27
+ return React.createElement(material.Stack, {
30
28
  gap: "1.5rem",
31
29
  sx: {
32
30
  display: 'flex',
@@ -34,30 +32,28 @@ var RuntimeOverlayAssigned = function RuntimeOverlayAssigned(_ref) {
34
32
  alignItems: 'center',
35
33
  width: '100%',
36
34
  height: '100%'
37
- },
38
- children: [jsxRuntime.jsx(material.Box, {
39
- component: "img",
40
- src: queue.default,
41
- alt: "queue",
42
- sx: {
43
- width: '100%',
44
- height: 'auto',
45
- maxWidth: '13.375rem'
46
- }
47
- }), jsxRuntime.jsx(material.Typography, {
48
- variant: "subtitle2",
49
- color: "text:secondary",
50
- sx: {
51
- whiteSpace: 'pre-wrap',
52
- textAlign: 'center'
53
- },
54
- children: timeout() ? intl.formatMessage({
55
- id: 'runbox.runtime.overlay.assigned.description_timeout'
56
- }) : intl.formatMessage({
57
- id: 'runbox.runtime.overlay.assigned.description'
58
- })
59
- })]
60
- });
35
+ }
36
+ }, React.createElement(material.Box, {
37
+ component: "img",
38
+ src: queue.default,
39
+ alt: "queue",
40
+ sx: {
41
+ width: '100%',
42
+ height: 'auto',
43
+ maxWidth: '13.375rem'
44
+ }
45
+ }), React.createElement(material.Typography, {
46
+ variant: "subtitle2",
47
+ color: "text:secondary",
48
+ sx: {
49
+ whiteSpace: 'pre-wrap',
50
+ textAlign: 'center'
51
+ }
52
+ }, timeout() ? intl.formatMessage({
53
+ id: 'runbox.runtime.overlay.assigned.description_timeout'
54
+ }) : intl.formatMessage({
55
+ id: 'runbox.runtime.overlay.assigned.description'
56
+ })));
61
57
  };
62
58
  var RuntimeOverlayAssigned$1 = new intl.IntlComponentBuilder(RuntimeOverlayAssigned).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('../locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('../locales/ja.json.js'); })).build();
63
59