@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/assets/queue.gif.js +2 -1
- package/cjs/assets/runbox_logo.png.js +2 -1
- package/cjs/assets/terminated.png.js +2 -1
- package/cjs/components/material-runbox/MaterialRunbox.js +20 -24
- package/cjs/components/material-runbox/MaterialRunboxBody.js +4 -10
- package/cjs/components/material-runbox/MaterialRunboxContent.js +103 -132
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +18 -27
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +87 -103
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -31
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -242
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -32
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -125
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -84
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -40
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +15 -27
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +36 -52
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +8 -11
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/cjs/components/material-runbox/runtime/Runtime.js +17 -25
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +29 -33
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +39 -40
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -72
- package/es/assets/queue.gif.js +2 -1
- package/es/assets/runbox_logo.png.js +2 -1
- package/es/assets/terminated.png.js +2 -1
- package/es/components/material-runbox/MaterialRunbox.js +20 -24
- package/es/components/material-runbox/MaterialRunboxBody.js +4 -6
- package/es/components/material-runbox/MaterialRunboxContent.js +103 -128
- package/es/components/material-runbox/MaterialRunboxFooter.js +18 -23
- package/es/components/material-runbox/MaterialRunboxHeader.js +88 -99
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -237
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -121
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -80
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -36
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +14 -22
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -47
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +7 -6
- package/es/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/es/components/material-runbox/runtime/Runtime.js +17 -21
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +30 -34
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -41
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -69
- package/package.json +11 -8
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -386
- package/cjs/components/material-runbox/contexts/index.js +0 -17
- package/cjs/components/material-runbox/hooks/index.js +0 -7
- package/cjs/components/material-runbox/index.js +0 -7
- package/cjs/components/material-runbox/locales/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -377
- package/es/components/material-runbox/contexts/index.js +0 -3
- package/es/components/material-runbox/hooks/index.js +0 -1
- package/es/components/material-runbox/index.js +0 -1
- 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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
35
|
+
const handleDialogClose = () => {
|
|
41
36
|
setDialogOpened(false);
|
|
42
37
|
};
|
|
43
38
|
/**
|
|
44
39
|
*
|
|
45
40
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
96
|
-
return
|
|
97
|
-
onClick:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
82
|
+
const renderConfirmDialog = () => {
|
|
116
83
|
if (!isDialogOpened) {
|
|
117
84
|
return null;
|
|
118
85
|
}
|
|
119
|
-
return
|
|
86
|
+
return React.createElement(Dialog, {
|
|
120
87
|
open: true,
|
|
121
88
|
maxWidth: "xs",
|
|
122
89
|
fullWidth: true,
|
|
123
|
-
onClose: handleDialogClose
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const {
|
|
23
|
+
start
|
|
24
|
+
} = useRunboxControl({
|
|
25
|
+
runbox,
|
|
26
|
+
courseId,
|
|
27
|
+
refetch
|
|
28
|
+
});
|
|
35
29
|
/**
|
|
36
30
|
*
|
|
37
31
|
*/
|
|
38
|
-
|
|
32
|
+
const handleDialogClose = () => {
|
|
39
33
|
setDialogOpened(false);
|
|
40
34
|
};
|
|
41
35
|
/**
|
|
42
36
|
*
|
|
43
37
|
*/
|
|
44
|
-
|
|
38
|
+
const handleRestartAction = () => {
|
|
45
39
|
setIsLoading(true);
|
|
46
|
-
start(true).catch(
|
|
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
|
-
|
|
58
|
-
return
|
|
59
|
-
onClick:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
61
|
+
const renderConfirmDialog = () => {
|
|
77
62
|
if (!isDialogOpened) {
|
|
78
63
|
return null;
|
|
79
64
|
}
|
|
80
|
-
return
|
|
65
|
+
return React.createElement(Dialog, {
|
|
81
66
|
maxWidth: "xs",
|
|
82
67
|
open: true,
|
|
83
68
|
fullWidth: true,
|
|
84
|
-
onClose: handleDialogClose
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
37
|
+
const renderShareMenuItem = () => {
|
|
41
38
|
if (!enableUrlShare) {
|
|
42
39
|
return null;
|
|
43
40
|
}
|
|
44
|
-
return
|
|
41
|
+
return React.createElement(MenuItem, {
|
|
45
42
|
disabled: !url,
|
|
46
|
-
onClick: handleShareAction
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
10
|
-
|
|
7
|
+
const MaterialRunboxApiContext = React.createContext({});
|
|
8
|
+
const useMaterialRunboxApiContext = () => {
|
|
11
9
|
return React.useContext(MaterialRunboxApiContext);
|
|
12
10
|
};
|
|
13
11
|
//
|
|
14
12
|
//
|
|
15
13
|
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
36
|
+
return React.createElement(MaterialRunboxApiContext.Provider, {
|
|
45
37
|
children: children,
|
|
46
38
|
value: materialRunboxApi
|
|
47
39
|
});
|