@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,5 +1,3 @@
1
- import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
1
  import React from 'react';
4
2
  import { useRawEliceIntl } from '@elice/intl';
5
3
  import { EliceIcon } from '@elice/mui-elements';
@@ -15,151 +13,108 @@ import '../contexts/MaterialRunboxContext.js';
15
13
  //
16
14
  //
17
15
  //
18
- var MaterialRunboxActionReset = function MaterialRunboxActionReset(_ref) {
19
- var runtime = _ref.runtime,
20
- courseId = _ref.courseId;
21
- _ref.handleMenuClose;
22
- var intl = useRawEliceIntl();
23
- var _useSnackbar = useSnackbar(),
24
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
25
- var materialRunboxApi = useMaterialRunboxApiContext();
26
- var _React$useState = React.useState(false),
27
- _React$useState2 = _slicedToArray(_React$useState, 2),
28
- isLoading = _React$useState2[0],
29
- setLoading = _React$useState2[1];
30
- var _React$useState3 = React.useState(false),
31
- _React$useState4 = _slicedToArray(_React$useState3, 2),
32
- isDialogOpened = _React$useState4[0],
33
- setDialogOpened = _React$useState4[1];
34
- var _useMaterialRunboxCom = useMaterialRunboxCommandContext(),
35
- isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
36
- setCommandIdToPing = _useMaterialRunboxCom.setCommandIdToPing;
16
+ const MaterialRunboxActionReset = ({
17
+ runtime,
18
+ courseId,
19
+ handleMenuClose
20
+ }) => {
21
+ const intl = useRawEliceIntl();
22
+ const {
23
+ enqueueSnackbar
24
+ } = useSnackbar();
25
+ const materialRunboxApi = useMaterialRunboxApiContext();
26
+ const [isLoading, setLoading] = React.useState(false);
27
+ const [isDialogOpened, setDialogOpened] = React.useState(false);
28
+ const {
29
+ isLastCommandRunning,
30
+ setCommandIdToPing
31
+ } = useMaterialRunboxCommandContext();
37
32
  /**
38
33
  *
39
34
  */
40
- var handleDialogClose = function handleDialogClose() {
35
+ const handleDialogClose = () => {
41
36
  setDialogOpened(false);
42
37
  };
43
38
  /**
44
39
  *
45
40
  */
46
- var handleReset = /*#__PURE__*/function () {
47
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
48
- var runtimeId, _yield$materialRunbox, commentId;
49
- return _regeneratorRuntime().wrap(function _callee$(_context) {
50
- while (1) switch (_context.prev = _context.next) {
51
- case 0:
52
- setLoading(true);
53
- _context.prev = 1;
54
- runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
55
- _context.next = 5;
56
- return materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
57
- runtimeId: runtimeId,
58
- eliceCourseId: courseId,
59
- runboxCommandPostRequest: {
60
- commandType: CommandType.ProjectFileReset
61
- }
62
- });
63
- case 5:
64
- _yield$materialRunbox = _context.sent;
65
- commentId = _yield$materialRunbox.id;
66
- setCommandIdToPing(commentId);
67
- handleDialogClose();
68
- _context.next = 14;
69
- break;
70
- case 11:
71
- _context.prev = 11;
72
- _context.t0 = _context["catch"](1);
73
- enqueueSnackbar(intl.formatMessage({
74
- id: 'runbox.action.reset.noti.error'
75
- }), {
76
- variant: 'error'
77
- });
78
- case 14:
79
- _context.prev = 14;
80
- setLoading(false);
81
- return _context.finish(14);
82
- case 17:
83
- case "end":
84
- return _context.stop();
41
+ const handleReset = async () => {
42
+ setLoading(true);
43
+ try {
44
+ const runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
45
+ const {
46
+ id: commentId
47
+ } = await materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
48
+ runtimeId,
49
+ eliceCourseId: courseId,
50
+ runboxCommandPostRequest: {
51
+ commandType: CommandType.ProjectFileReset
85
52
  }
86
- }, _callee, null, [[1, 11, 14, 17]]);
87
- }));
88
- return function handleReset() {
89
- return _ref2.apply(this, arguments);
90
- };
91
- }();
53
+ });
54
+ setCommandIdToPing(commentId);
55
+ handleDialogClose();
56
+ } catch (err) {
57
+ enqueueSnackbar(intl.formatMessage({
58
+ id: 'runbox.action.reset.noti.error'
59
+ }), {
60
+ variant: 'error'
61
+ });
62
+ } finally {
63
+ setLoading(false);
64
+ }
65
+ };
92
66
  /**
93
67
  *
94
68
  */
95
- var renderResetMenuItem = function renderResetMenuItem() {
96
- return jsxs(MenuItem, {
97
- onClick: function onClick() {
98
- return setDialogOpened(true);
99
- },
100
- disabled: isLastCommandRunning,
101
- children: [jsx(ListItemIcon, {
102
- children: jsx(EliceIcon, {
103
- icon: faRefresh
104
- })
105
- }), jsx(ListItemText, {
106
- children: intl.formatMessage({
107
- id: 'runbox.action.reset.title'
108
- })
109
- })]
110
- });
69
+ const renderResetMenuItem = () => {
70
+ return React.createElement(MenuItem, {
71
+ onClick: () => setDialogOpened(true),
72
+ disabled: isLastCommandRunning
73
+ }, React.createElement(ListItemIcon, null, React.createElement(EliceIcon, {
74
+ icon: faRefresh
75
+ })), React.createElement(ListItemText, null, intl.formatMessage({
76
+ id: 'runbox.action.reset.title'
77
+ })));
111
78
  };
112
79
  /**
113
80
  *
114
81
  */
115
- var renderConfirmDialog = function renderConfirmDialog() {
82
+ const renderConfirmDialog = () => {
116
83
  if (!isDialogOpened) {
117
84
  return null;
118
85
  }
119
- return jsxs(Dialog, {
86
+ return React.createElement(Dialog, {
120
87
  open: true,
121
88
  maxWidth: "xs",
122
89
  fullWidth: true,
123
- onClose: handleDialogClose,
124
- children: [jsx(DialogTitle, {
125
- children: intl.formatMessage({
126
- id: 'runbox.action.reset.title'
127
- })
128
- }), jsx(DialogContent, {
129
- children: jsx(DialogContentText, {
130
- sx: {
131
- whiteSpace: 'pre-line'
132
- },
133
- children: intl.formatMessage({
134
- id: 'runbox.action.reset.dialog.description'
135
- })
136
- })
137
- }), jsxs(DialogActions, {
138
- children: [jsx(Button, {
139
- color: "inherit",
140
- disabled: isLoading,
141
- onClick: handleDialogClose,
142
- children: intl.formatMessage({
143
- id: 'runbox.common.close'
144
- })
145
- }), jsx(LoadingButton, {
146
- variant: "contained",
147
- color: "warning",
148
- loading: isLoading || isLastCommandRunning,
149
- onClick: handleReset,
150
- children: intl.formatMessage({
151
- id: 'runbox.action.reset.dialog.actions.confirm'
152
- })
153
- })]
154
- })]
155
- });
90
+ onClose: handleDialogClose
91
+ }, React.createElement(DialogTitle, null, intl.formatMessage({
92
+ id: 'runbox.action.reset.title'
93
+ })), React.createElement(DialogContent, null, React.createElement(DialogContentText, {
94
+ sx: {
95
+ whiteSpace: 'pre-line'
96
+ }
97
+ }, intl.formatMessage({
98
+ id: 'runbox.action.reset.dialog.description'
99
+ }))), React.createElement(DialogActions, null, React.createElement(Button, {
100
+ color: "inherit",
101
+ disabled: isLoading,
102
+ onClick: handleDialogClose
103
+ }, intl.formatMessage({
104
+ id: 'runbox.common.close'
105
+ })), React.createElement(LoadingButton, {
106
+ variant: "contained",
107
+ color: "warning",
108
+ loading: isLoading || isLastCommandRunning,
109
+ onClick: handleReset
110
+ }, intl.formatMessage({
111
+ id: 'runbox.action.reset.dialog.actions.confirm'
112
+ }))));
156
113
  };
157
114
  //
158
115
  //
159
116
  //
160
- return jsxs(Fragment, {
161
- children: [renderResetMenuItem(), renderConfirmDialog()]
162
- });
117
+ return React.createElement(React.Fragment, null, renderResetMenuItem(), renderConfirmDialog());
163
118
  };
164
119
 
165
120
  export { MaterialRunboxActionReset as default };
@@ -1,5 +1,3 @@
1
- import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
1
  import React from 'react';
4
2
  import { useRawEliceIntl } from '@elice/intl';
5
3
  import { EliceIcon } from '@elice/mui-elements';
@@ -11,41 +9,35 @@ import { useRunboxControl } from '../hooks/useRunboxControl.js';
11
9
  //
12
10
  //
13
11
  //
14
- var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
15
- var runbox = _ref.runbox,
16
- courseId = _ref.courseId,
17
- refetch = _ref.refetch,
18
- handleMenuClose = _ref.handleMenuClose;
19
- var intl = useRawEliceIntl();
20
- var _React$useState = React.useState(false),
21
- _React$useState2 = _slicedToArray(_React$useState, 2),
22
- isLoading = _React$useState2[0],
23
- setIsLoading = _React$useState2[1];
24
- var _React$useState3 = React.useState(false),
25
- _React$useState4 = _slicedToArray(_React$useState3, 2),
26
- isDialogOpened = _React$useState4[0],
27
- setDialogOpened = _React$useState4[1];
12
+ const MaterialRunboxActionRestart = ({
13
+ runbox,
14
+ courseId,
15
+ refetch,
16
+ handleMenuClose
17
+ }) => {
18
+ const intl = useRawEliceIntl();
19
+ const [isLoading, setIsLoading] = React.useState(false);
20
+ const [isDialogOpened, setDialogOpened] = React.useState(false);
28
21
  // restart
29
- var _useRunboxControl = useRunboxControl({
30
- runbox: runbox,
31
- courseId: courseId,
32
- refetch: refetch
33
- }),
34
- start = _useRunboxControl.start;
22
+ const {
23
+ start
24
+ } = useRunboxControl({
25
+ runbox,
26
+ courseId,
27
+ refetch
28
+ });
35
29
  /**
36
30
  *
37
31
  */
38
- var handleDialogClose = function handleDialogClose() {
32
+ const handleDialogClose = () => {
39
33
  setDialogOpened(false);
40
34
  };
41
35
  /**
42
36
  *
43
37
  */
44
- var handleRestartAction = function handleRestartAction() {
38
+ const handleRestartAction = () => {
45
39
  setIsLoading(true);
46
- start(true).catch(function () {
47
- return void 0;
48
- }).finally(function () {
40
+ start(true).catch(() => void 0).finally(() => {
49
41
  handleDialogClose();
50
42
  handleMenuClose();
51
43
  setIsLoading(false);
@@ -54,73 +46,54 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
54
46
  /**
55
47
  *
56
48
  */
57
- var renderRestartMenuItem = function renderRestartMenuItem() {
58
- return jsxs(MenuItem, {
59
- onClick: function onClick() {
60
- return setDialogOpened(true);
61
- },
62
- children: [jsx(ListItemIcon, {
63
- children: jsx(EliceIcon, {
64
- icon: faRotateRight
65
- })
66
- }), jsx(ListItemText, {
67
- children: intl.formatMessage({
68
- id: 'runbox.action.restart.title'
69
- })
70
- })]
71
- });
49
+ const renderRestartMenuItem = () => {
50
+ return React.createElement(MenuItem, {
51
+ onClick: () => setDialogOpened(true)
52
+ }, React.createElement(ListItemIcon, null, React.createElement(EliceIcon, {
53
+ icon: faRotateRight
54
+ })), React.createElement(ListItemText, null, intl.formatMessage({
55
+ id: 'runbox.action.restart.title'
56
+ })));
72
57
  };
73
58
  /**
74
59
  *
75
60
  */
76
- var renderConfirmDialog = function renderConfirmDialog() {
61
+ const renderConfirmDialog = () => {
77
62
  if (!isDialogOpened) {
78
63
  return null;
79
64
  }
80
- return jsxs(Dialog, {
65
+ return React.createElement(Dialog, {
81
66
  maxWidth: "xs",
82
67
  open: true,
83
68
  fullWidth: true,
84
- onClose: handleDialogClose,
85
- children: [jsx(DialogTitle, {
86
- children: intl.formatMessage({
87
- id: 'runbox.action.restart.title'
88
- })
89
- }), jsx(DialogContent, {
90
- children: jsx(DialogContentText, {
91
- sx: {
92
- whiteSpace: 'pre-line'
93
- },
94
- children: intl.formatMessage({
95
- id: 'runbox.action.restart.dialog.description'
96
- })
97
- })
98
- }), jsxs(DialogActions, {
99
- children: [jsx(Button, {
100
- color: "inherit",
101
- disabled: isLoading,
102
- onClick: handleDialogClose,
103
- children: intl.formatMessage({
104
- id: 'runbox.common.close'
105
- })
106
- }), jsx(LoadingButton, {
107
- variant: "contained",
108
- color: "warning",
109
- loading: isLoading,
110
- onClick: handleRestartAction,
111
- children: intl.formatMessage({
112
- id: 'runbox.action.restart.dialog.actions.confirm'
113
- })
114
- })]
115
- })]
116
- });
69
+ onClose: handleDialogClose
70
+ }, React.createElement(DialogTitle, null, intl.formatMessage({
71
+ id: 'runbox.action.restart.title'
72
+ })), React.createElement(DialogContent, null, React.createElement(DialogContentText, {
73
+ sx: {
74
+ whiteSpace: 'pre-line'
75
+ }
76
+ }, intl.formatMessage({
77
+ id: 'runbox.action.restart.dialog.description'
78
+ }))), React.createElement(DialogActions, null, React.createElement(Button, {
79
+ color: "inherit",
80
+ disabled: isLoading,
81
+ onClick: handleDialogClose
82
+ }, intl.formatMessage({
83
+ id: 'runbox.common.close'
84
+ })), React.createElement(LoadingButton, {
85
+ variant: "contained",
86
+ color: "warning",
87
+ loading: isLoading,
88
+ onClick: handleRestartAction
89
+ }, intl.formatMessage({
90
+ id: 'runbox.action.restart.dialog.actions.confirm'
91
+ }))));
117
92
  };
118
93
  //
119
94
  //
120
95
  //
121
- return jsxs(Fragment, {
122
- children: [renderRestartMenuItem(), renderConfirmDialog()]
123
- });
96
+ return React.createElement(React.Fragment, null, renderRestartMenuItem(), renderConfirmDialog());
124
97
  };
125
98
 
126
99
  export { MaterialRunboxActionRestart as default };
@@ -1,5 +1,3 @@
1
- import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
1
  import React from 'react';
4
2
  import { useCopyToClipboard } from 'react-use';
5
3
  import { useRawEliceIntl } from '@elice/intl';
@@ -15,50 +13,44 @@ import { useMaterialRunboxContext } from '../contexts/MaterialRunboxContext.js';
15
13
  //
16
14
  //
17
15
  //
18
- var MaterialRunboxActionShare = function MaterialRunboxActionShare(_ref) {
19
- var handleMenuClose = _ref.handleMenuClose;
20
- var intl = useRawEliceIntl();
21
- var _useSnackbar = useSnackbar(),
22
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
23
- var _useMaterialRunboxCon = useMaterialRunboxContext(),
24
- enableUrlShare = _useMaterialRunboxCon.enableUrlShare;
25
- var _useEliceRunboxRunnin = useEliceRunboxRunning(),
26
- url = _useEliceRunboxRunnin.url;
27
- var _useCopyToClipboard = useCopyToClipboard(),
28
- _useCopyToClipboard2 = _slicedToArray(_useCopyToClipboard, 2),
29
- _useCopyToClipboard2$ = _useCopyToClipboard2[0],
30
- clipboardValue = _useCopyToClipboard2$.value,
31
- error = _useCopyToClipboard2$.error,
32
- copy = _useCopyToClipboard2[1];
33
- var _React$useState = React.useState(false),
34
- _React$useState2 = _slicedToArray(_React$useState, 2),
35
- isClipboardCopied = _React$useState2[0],
36
- setClipboardCopied = _React$useState2[1];
16
+ const MaterialRunboxActionShare = ({
17
+ handleMenuClose
18
+ }) => {
19
+ const intl = useRawEliceIntl();
20
+ const {
21
+ enqueueSnackbar
22
+ } = useSnackbar();
23
+ const {
24
+ enableUrlShare
25
+ } = useMaterialRunboxContext();
26
+ const {
27
+ url
28
+ } = useEliceRunboxRunning();
29
+ const [{
30
+ value: clipboardValue,
31
+ error
32
+ }, copy] = useCopyToClipboard();
33
+ const [isClipboardCopied, setClipboardCopied] = React.useState(false);
37
34
  /**
38
35
  *
39
36
  */
40
- var renderShareMenuItem = function renderShareMenuItem() {
37
+ const renderShareMenuItem = () => {
41
38
  if (!enableUrlShare) {
42
39
  return null;
43
40
  }
44
- return jsxs(MenuItem, {
41
+ return React.createElement(MenuItem, {
45
42
  disabled: !url,
46
- onClick: handleShareAction,
47
- children: [jsx(ListItemIcon, {
48
- children: jsx(EliceIcon, {
49
- icon: faLinkSimple
50
- })
51
- }), jsx(ListItemText, {
52
- children: intl.formatMessage({
53
- id: 'runbox.action.share.title'
54
- })
55
- })]
56
- });
43
+ onClick: handleShareAction
44
+ }, React.createElement(ListItemIcon, null, React.createElement(EliceIcon, {
45
+ icon: faLinkSimple
46
+ })), React.createElement(ListItemText, null, intl.formatMessage({
47
+ id: 'runbox.action.share.title'
48
+ })));
57
49
  };
58
50
  /**
59
51
  *
60
52
  */
61
- var handleShareAction = function handleShareAction() {
53
+ const handleShareAction = () => {
62
54
  if (url) {
63
55
  copy(url);
64
56
  if (!error) {
@@ -70,7 +62,7 @@ var MaterialRunboxActionShare = function MaterialRunboxActionShare(_ref) {
70
62
  //
71
63
  //
72
64
  //
73
- React.useEffect(function () {
65
+ React.useEffect(() => {
74
66
  if (!isClipboardCopied) {
75
67
  return;
76
68
  }
@@ -1,47 +1,39 @@
1
- import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsx } from 'react/jsx-runtime';
3
1
  import React from 'react';
4
2
  import { RunboxApi, RuntimeApi, RuntimeTemplateApi } from '@elice/openapi-client-material-runbox';
5
3
 
6
4
  //
7
5
  //
8
6
  //
9
- var MaterialRunboxApiContext = React.createContext({});
10
- var useMaterialRunboxApiContext = function useMaterialRunboxApiContext() {
7
+ const MaterialRunboxApiContext = React.createContext({});
8
+ const useMaterialRunboxApiContext = () => {
11
9
  return React.useContext(MaterialRunboxApiContext);
12
10
  };
13
11
  //
14
12
  //
15
13
  //
16
- var MaterialRunboxApiContextProvider = function MaterialRunboxApiContextProvider(_ref) {
17
- var children = _ref.children,
18
- eliceMaterialRunboxApiConfiguration = _ref.eliceMaterialRunboxApiConfiguration;
19
- var createMaterialRunboxApi = function createMaterialRunboxApi() {
20
- return Object.freeze({
21
- runbox: new RunboxApi(eliceMaterialRunboxApiConfiguration),
22
- runtime: new RuntimeApi(eliceMaterialRunboxApiConfiguration),
23
- runtimeTemplate: new RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
24
- });
25
- };
14
+ const MaterialRunboxApiContextProvider = ({
15
+ children,
16
+ eliceMaterialRunboxApiConfiguration
17
+ }) => {
18
+ const createMaterialRunboxApi = () => Object.freeze({
19
+ runbox: new RunboxApi(eliceMaterialRunboxApiConfiguration),
20
+ runtime: new RuntimeApi(eliceMaterialRunboxApiConfiguration),
21
+ runtimeTemplate: new RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
22
+ });
26
23
  //
27
24
  //
28
25
  //
29
- var _React$useState = React.useState(createMaterialRunboxApi),
30
- _React$useState2 = _slicedToArray(_React$useState, 2),
31
- materialRunboxApi = _React$useState2[0],
32
- setMaterialRunboxApi = _React$useState2[1];
26
+ const [materialRunboxApi, setMaterialRunboxApi] = React.useState(createMaterialRunboxApi);
33
27
  //
34
28
  //
35
29
  //
36
- React.useEffect(function () {
37
- return setMaterialRunboxApi(createMaterialRunboxApi);
38
- },
30
+ React.useEffect(() => setMaterialRunboxApi(createMaterialRunboxApi),
39
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
40
32
  [eliceMaterialRunboxApiConfiguration]);
41
33
  //
42
34
  //
43
35
  //
44
- return jsx(MaterialRunboxApiContext.Provider, {
36
+ return React.createElement(MaterialRunboxApiContext.Provider, {
45
37
  children: children,
46
38
  value: materialRunboxApi
47
39
  });