@elice/material-runbox 1.240718.0-trasncript.0 → 1.240718.0-trasncript.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/_virtual/_rollupPluginBabelHelpers.js +386 -0
  2. package/cjs/assets/queue.gif.js +1 -2
  3. package/cjs/assets/runbox_logo.png.js +1 -2
  4. package/cjs/assets/terminated.png.js +1 -2
  5. package/cjs/components/material-runbox/MaterialRunbox.js +24 -20
  6. package/cjs/components/material-runbox/MaterialRunboxBody.js +10 -4
  7. package/cjs/components/material-runbox/MaterialRunboxContent.js +132 -103
  8. package/cjs/components/material-runbox/MaterialRunboxFooter.js +27 -18
  9. package/cjs/components/material-runbox/MaterialRunboxHeader.js +103 -87
  10. package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +31 -27
  11. package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +242 -159
  12. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +32 -28
  13. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +125 -76
  14. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +84 -53
  15. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +40 -28
  16. package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +27 -15
  17. package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +52 -36
  18. package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +11 -8
  19. package/cjs/components/material-runbox/contexts/index.js +17 -0
  20. package/cjs/components/material-runbox/hooks/index.js +7 -0
  21. package/cjs/components/material-runbox/hooks/useRunboxControl.js +62 -38
  22. package/cjs/components/material-runbox/index.js +7 -0
  23. package/cjs/components/material-runbox/locales/index.js +13 -0
  24. package/cjs/components/material-runbox/runtime/Runtime.js +25 -17
  25. package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +33 -29
  26. package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -39
  27. package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +72 -57
  28. package/es/_virtual/_rollupPluginBabelHelpers.js +377 -0
  29. package/es/assets/queue.gif.js +1 -2
  30. package/es/assets/runbox_logo.png.js +1 -2
  31. package/es/assets/terminated.png.js +1 -2
  32. package/es/components/material-runbox/MaterialRunbox.js +24 -20
  33. package/es/components/material-runbox/MaterialRunboxBody.js +6 -4
  34. package/es/components/material-runbox/MaterialRunboxContent.js +128 -103
  35. package/es/components/material-runbox/MaterialRunboxFooter.js +23 -18
  36. package/es/components/material-runbox/MaterialRunboxHeader.js +99 -88
  37. package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
  38. package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +237 -159
  39. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
  40. package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +121 -76
  41. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +80 -53
  42. package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +36 -28
  43. package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +22 -14
  44. package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +47 -35
  45. package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -7
  46. package/es/components/material-runbox/contexts/index.js +3 -0
  47. package/es/components/material-runbox/hooks/index.js +1 -0
  48. package/es/components/material-runbox/hooks/useRunboxControl.js +62 -38
  49. package/es/components/material-runbox/index.js +1 -0
  50. package/es/components/material-runbox/locales/index.js +4 -0
  51. package/es/components/material-runbox/runtime/Runtime.js +21 -17
  52. package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +34 -30
  53. package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +41 -40
  54. package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +69 -58
  55. package/package.json +8 -11
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import { useEliceRunboxRunning } from '@elice/runbox-client';
3
4
  import { Menu } from '@mui/material';
@@ -8,22 +9,20 @@ import MaterialRunboxActionShare from './MaterialRunboxActionShare.js';
8
9
  //
9
10
  //
10
11
  //
11
- const MaterialRunboxActionMenu = ({
12
- runbox,
13
- runtime,
14
- courseId,
15
- menuAnchorEl,
16
- refetch,
17
- handleMenuClose
18
- }) => {
19
- const {
20
- status
21
- } = useEliceRunboxRunning();
22
- const isRunboxRunning = status === 'running';
12
+ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
13
+ var runbox = _ref.runbox,
14
+ runtime = _ref.runtime,
15
+ courseId = _ref.courseId,
16
+ menuAnchorEl = _ref.menuAnchorEl,
17
+ refetch = _ref.refetch,
18
+ handleMenuClose = _ref.handleMenuClose;
19
+ var _useEliceRunboxRunnin = useEliceRunboxRunning(),
20
+ status = _useEliceRunboxRunnin.status;
21
+ var isRunboxRunning = status === 'running';
23
22
  //
24
23
  //
25
24
  //
26
- React.useEffect(() => {
25
+ React.useEffect(function () {
27
26
  if (!isRunboxRunning) {
28
27
  handleMenuClose();
29
28
  }
@@ -31,7 +30,7 @@ const MaterialRunboxActionMenu = ({
31
30
  //
32
31
  //
33
32
  //
34
- return React.createElement(Menu, {
33
+ return jsxs(Menu, {
35
34
  open: Boolean(menuAnchorEl),
36
35
  anchorEl: menuAnchorEl,
37
36
  anchorOrigin: {
@@ -42,20 +41,21 @@ const MaterialRunboxActionMenu = ({
42
41
  vertical: 'top',
43
42
  horizontal: 'right'
44
43
  },
45
- onClose: handleMenuClose
46
- }, React.createElement(MaterialRunboxActionShare, {
47
- handleMenuClose: handleMenuClose
48
- }), React.createElement(MaterialRunboxActionRestart, {
49
- runbox: runbox,
50
- runtime: runtime,
51
- courseId: courseId,
52
- refetch: refetch,
53
- handleMenuClose: handleMenuClose
54
- }), React.createElement(MaterialRunboxActionReset, {
55
- runtime: runtime,
56
- courseId: courseId,
57
- handleMenuClose: handleMenuClose
58
- }));
44
+ onClose: handleMenuClose,
45
+ children: [jsx(MaterialRunboxActionShare, {
46
+ handleMenuClose: handleMenuClose
47
+ }), jsx(MaterialRunboxActionRestart, {
48
+ runbox: runbox,
49
+ runtime: runtime,
50
+ courseId: courseId,
51
+ refetch: refetch,
52
+ handleMenuClose: handleMenuClose
53
+ }), jsx(MaterialRunboxActionReset, {
54
+ runtime: runtime,
55
+ courseId: courseId,
56
+ handleMenuClose: handleMenuClose
57
+ })]
58
+ });
59
59
  };
60
60
 
61
61
  export { MaterialRunboxActionMenu as default };
@@ -1,3 +1,5 @@
1
+ import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
3
  import React from 'react';
2
4
  import { useRawEliceIntl } from '@elice/intl';
3
5
  import { EliceIcon } from '@elice/mui-elements';
@@ -13,108 +15,151 @@ import '../contexts/MaterialRunboxContext.js';
13
15
  //
14
16
  //
15
17
  //
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();
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;
32
37
  /**
33
38
  *
34
39
  */
35
- const handleDialogClose = () => {
40
+ var handleDialogClose = function handleDialogClose() {
36
41
  setDialogOpened(false);
37
42
  };
38
43
  /**
39
44
  *
40
45
  */
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
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();
52
85
  }
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
- };
86
+ }, _callee, null, [[1, 11, 14, 17]]);
87
+ }));
88
+ return function handleReset() {
89
+ return _ref2.apply(this, arguments);
90
+ };
91
+ }();
66
92
  /**
67
93
  *
68
94
  */
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
- })));
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
+ });
78
111
  };
79
112
  /**
80
113
  *
81
114
  */
82
- const renderConfirmDialog = () => {
115
+ var renderConfirmDialog = function renderConfirmDialog() {
83
116
  if (!isDialogOpened) {
84
117
  return null;
85
118
  }
86
- return React.createElement(Dialog, {
119
+ return jsxs(Dialog, {
87
120
  open: true,
88
121
  maxWidth: "xs",
89
122
  fullWidth: true,
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
- }))));
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
+ });
113
156
  };
114
157
  //
115
158
  //
116
159
  //
117
- return React.createElement(React.Fragment, null, renderResetMenuItem(), renderConfirmDialog());
160
+ return jsxs(Fragment, {
161
+ children: [renderResetMenuItem(), renderConfirmDialog()]
162
+ });
118
163
  };
119
164
 
120
165
  export { MaterialRunboxActionReset as default };
@@ -1,3 +1,5 @@
1
+ import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
3
  import React from 'react';
2
4
  import { useRawEliceIntl } from '@elice/intl';
3
5
  import { EliceIcon } from '@elice/mui-elements';
@@ -9,35 +11,41 @@ import { useRunboxControl } from '../hooks/useRunboxControl.js';
9
11
  //
10
12
  //
11
13
  //
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);
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];
21
28
  // restart
22
- const {
23
- start
24
- } = useRunboxControl({
25
- runbox,
26
- courseId,
27
- refetch
28
- });
29
+ var _useRunboxControl = useRunboxControl({
30
+ runbox: runbox,
31
+ courseId: courseId,
32
+ refetch: refetch
33
+ }),
34
+ start = _useRunboxControl.start;
29
35
  /**
30
36
  *
31
37
  */
32
- const handleDialogClose = () => {
38
+ var handleDialogClose = function handleDialogClose() {
33
39
  setDialogOpened(false);
34
40
  };
35
41
  /**
36
42
  *
37
43
  */
38
- const handleRestartAction = () => {
44
+ var handleRestartAction = function handleRestartAction() {
39
45
  setIsLoading(true);
40
- start(true).catch(() => void 0).finally(() => {
46
+ start(true).catch(function () {
47
+ return void 0;
48
+ }).finally(function () {
41
49
  handleDialogClose();
42
50
  handleMenuClose();
43
51
  setIsLoading(false);
@@ -46,54 +54,73 @@ const MaterialRunboxActionRestart = ({
46
54
  /**
47
55
  *
48
56
  */
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
- })));
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
+ });
57
72
  };
58
73
  /**
59
74
  *
60
75
  */
61
- const renderConfirmDialog = () => {
76
+ var renderConfirmDialog = function renderConfirmDialog() {
62
77
  if (!isDialogOpened) {
63
78
  return null;
64
79
  }
65
- return React.createElement(Dialog, {
80
+ return jsxs(Dialog, {
66
81
  maxWidth: "xs",
67
82
  open: true,
68
83
  fullWidth: true,
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
- }))));
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
+ });
92
117
  };
93
118
  //
94
119
  //
95
120
  //
96
- return React.createElement(React.Fragment, null, renderRestartMenuItem(), renderConfirmDialog());
121
+ return jsxs(Fragment, {
122
+ children: [renderRestartMenuItem(), renderConfirmDialog()]
123
+ });
97
124
  };
98
125
 
99
126
  export { MaterialRunboxActionRestart as default };
@@ -1,3 +1,5 @@
1
+ import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
3
  import React from 'react';
2
4
  import { useCopyToClipboard } from 'react-use';
3
5
  import { useRawEliceIntl } from '@elice/intl';
@@ -13,44 +15,50 @@ import { useMaterialRunboxContext } from '../contexts/MaterialRunboxContext.js';
13
15
  //
14
16
  //
15
17
  //
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);
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];
34
37
  /**
35
38
  *
36
39
  */
37
- const renderShareMenuItem = () => {
40
+ var renderShareMenuItem = function renderShareMenuItem() {
38
41
  if (!enableUrlShare) {
39
42
  return null;
40
43
  }
41
- return React.createElement(MenuItem, {
44
+ return jsxs(MenuItem, {
42
45
  disabled: !url,
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
- })));
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
+ });
49
57
  };
50
58
  /**
51
59
  *
52
60
  */
53
- const handleShareAction = () => {
61
+ var handleShareAction = function handleShareAction() {
54
62
  if (url) {
55
63
  copy(url);
56
64
  if (!error) {
@@ -62,7 +70,7 @@ const MaterialRunboxActionShare = ({
62
70
  //
63
71
  //
64
72
  //
65
- React.useEffect(() => {
73
+ React.useEffect(function () {
66
74
  if (!isClipboardCopied) {
67
75
  return;
68
76
  }
@@ -1,39 +1,47 @@
1
+ import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsx } from 'react/jsx-runtime';
1
3
  import React from 'react';
2
4
  import { RunboxApi, RuntimeApi, RuntimeTemplateApi } from '@elice/openapi-client-material-runbox';
3
5
 
4
6
  //
5
7
  //
6
8
  //
7
- const MaterialRunboxApiContext = React.createContext({});
8
- const useMaterialRunboxApiContext = () => {
9
+ var MaterialRunboxApiContext = React.createContext({});
10
+ var useMaterialRunboxApiContext = function useMaterialRunboxApiContext() {
9
11
  return React.useContext(MaterialRunboxApiContext);
10
12
  };
11
13
  //
12
14
  //
13
15
  //
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
- });
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
+ };
23
26
  //
24
27
  //
25
28
  //
26
- const [materialRunboxApi, setMaterialRunboxApi] = React.useState(createMaterialRunboxApi);
29
+ var _React$useState = React.useState(createMaterialRunboxApi),
30
+ _React$useState2 = _slicedToArray(_React$useState, 2),
31
+ materialRunboxApi = _React$useState2[0],
32
+ setMaterialRunboxApi = _React$useState2[1];
27
33
  //
28
34
  //
29
35
  //
30
- React.useEffect(() => setMaterialRunboxApi(createMaterialRunboxApi),
36
+ React.useEffect(function () {
37
+ return setMaterialRunboxApi(createMaterialRunboxApi);
38
+ },
31
39
  // eslint-disable-next-line react-hooks/exhaustive-deps
32
40
  [eliceMaterialRunboxApiConfiguration]);
33
41
  //
34
42
  //
35
43
  //
36
- return React.createElement(MaterialRunboxApiContext.Provider, {
44
+ return jsx(MaterialRunboxApiContext.Provider, {
37
45
  children: children,
38
46
  value: materialRunboxApi
39
47
  });