@elice/material-runbox 1.260825.0-runboxusability.2 → 1.260826.0
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/runbox_logo.png.js +7 -0
- package/cjs/components/material-runbox/MaterialRunboxContent.js +2 -1
- package/cjs/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +64 -0
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +29 -12
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +1 -22
- package/cjs/components/material-runbox/hooks/index.d.ts +0 -2
- package/cjs/components/material-runbox/hooks/index.js +0 -10
- package/cjs/components/material-runbox/locales/en.json.js +1 -1
- package/cjs/components/material-runbox/locales/ja.json.js +1 -1
- package/cjs/components/material-runbox/locales/ko.json.js +1 -1
- package/cjs/components/material-runbox/locales/th.json.js +1 -1
- package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +90 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.js +16 -20
- package/cjs/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +81 -21
- package/es/assets/runbox_logo.png.js +3 -0
- package/es/components/material-runbox/MaterialRunboxContent.js +2 -1
- package/es/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
- package/es/components/material-runbox/MaterialRunboxFooter.js +56 -0
- package/es/components/material-runbox/MaterialRunboxHeader.js +30 -13
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +3 -24
- package/es/components/material-runbox/hooks/index.d.ts +0 -2
- package/es/components/material-runbox/hooks/index.js +0 -2
- package/es/components/material-runbox/locales/en.json.js +1 -1
- package/es/components/material-runbox/locales/ja.json.js +1 -1
- package/es/components/material-runbox/locales/ko.json.js +1 -1
- package/es/components/material-runbox/locales/th.json.js +1 -1
- package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
- package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +86 -0
- package/es/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
- package/es/components/material-runbox/timer/MaterialRunboxTimer.js +15 -19
- package/es/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +78 -18
- package/package.json +6 -6
- package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +0 -14
- package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.js +0 -65
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -67
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -89
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -12
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -35
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -142
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -41
- package/cjs/components/material-runbox/status/index.d.ts +0 -4
- package/cjs/components/material-runbox/status/index.js +0 -9
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -117
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -56
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -118
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -50
- package/es/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +0 -14
- package/es/components/material-runbox/hooks/useRunboxNetworkStatus.js +0 -59
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -63
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -81
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -12
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -31
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -138
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -37
- package/es/components/material-runbox/status/index.d.ts +0 -4
- package/es/components/material-runbox/status/index.js +0 -2
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -113
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -52
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -114
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -46
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { Typography, Stack } from '@mui/material';
|
|
4
|
-
import MaterialRunboxQuotaTimePart from './MaterialRunboxQuotaTimePart.js';
|
|
5
|
-
import { getTimeParts } from '../../../utils/time.js';
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
/**
|
|
11
|
-
* Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
|
|
12
|
-
*/
|
|
13
|
-
var MaterialRunboxQuotaAmount = function MaterialRunboxQuotaAmount(_ref) {
|
|
14
|
-
var remainingQuota = _ref.remainingQuota,
|
|
15
|
-
quota = _ref.quota,
|
|
16
|
-
color = _ref.color;
|
|
17
|
-
var intl = useRawEliceIntl();
|
|
18
|
-
var _getTimeParts = getTimeParts(remainingQuota * 60),
|
|
19
|
-
remainingHours = _getTimeParts.hours,
|
|
20
|
-
remainingMinutes = _getTimeParts.minutes;
|
|
21
|
-
var _getTimeParts2 = getTimeParts(quota * 60),
|
|
22
|
-
totalHours = _getTimeParts2.hours,
|
|
23
|
-
totalMinutes = _getTimeParts2.minutes;
|
|
24
|
-
return jsxs(Typography, {
|
|
25
|
-
variant: "body2",
|
|
26
|
-
children: [jsxs(Stack, {
|
|
27
|
-
component: "span",
|
|
28
|
-
display: "inline-flex",
|
|
29
|
-
direction: "row",
|
|
30
|
-
gap: "0.25rem",
|
|
31
|
-
children: [jsx(MaterialRunboxQuotaTimePart, {
|
|
32
|
-
value: remainingHours,
|
|
33
|
-
unit: "hour",
|
|
34
|
-
color: color
|
|
35
|
-
}), jsx(MaterialRunboxQuotaTimePart, {
|
|
36
|
-
value: remainingMinutes,
|
|
37
|
-
unit: "minute",
|
|
38
|
-
color: color
|
|
39
|
-
})]
|
|
40
|
-
}), " / ", [totalHours > 0 ? intl.formatNumber(totalHours, {
|
|
41
|
-
style: 'unit',
|
|
42
|
-
unit: 'hour',
|
|
43
|
-
unitDisplay: 'short'
|
|
44
|
-
}) : null, totalMinutes > 0 ? intl.formatNumber(totalMinutes, {
|
|
45
|
-
style: 'unit',
|
|
46
|
-
unit: 'minute',
|
|
47
|
-
unitDisplay: 'short'
|
|
48
|
-
}) : null].filter(Boolean).join(' ')]
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { MaterialRunboxQuotaAmount as default };
|
package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface MaterialRunboxQuotaPerSessionAlmostEndDialogProps {
|
|
2
|
-
open: boolean;
|
|
3
|
-
onClose: () => void;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Warns the learner that the time granted to *this connection* is about to run out.
|
|
7
|
-
*
|
|
8
|
-
* Unlike the total quota, the learner can reconnect and keep going as long as total
|
|
9
|
-
* time is left — so this dialog is about saving work, not about the practice ending.
|
|
10
|
-
*/
|
|
11
|
-
declare const MaterialRunboxQuotaPerSessionAlmostEndDialog: React.FC<MaterialRunboxQuotaPerSessionAlmostEndDialogProps>;
|
|
12
|
-
export default MaterialRunboxQuotaPerSessionAlmostEndDialog;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { useEliceRunboxQuota } from '@elice/runbox-client';
|
|
4
|
-
import { Dialog, DialogTitle, DialogContent, Stack, Card, Typography, Divider, DialogActions, Button } from '@mui/material';
|
|
5
|
-
import { QUOTA_ALMOST_END_MINUTES, QUOTA_PER_SESSION_ALMOST_END_MINUTES } from '../hooks/useRunboxSessionEndWarning.js';
|
|
6
|
-
import MaterialRunboxQuotaAmount from './MaterialRunboxQuotaAmount.js';
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
/**
|
|
12
|
-
* Warns the learner that the time granted to *this connection* is about to run out.
|
|
13
|
-
*
|
|
14
|
-
* Unlike the total quota, the learner can reconnect and keep going as long as total
|
|
15
|
-
* time is left — so this dialog is about saving work, not about the practice ending.
|
|
16
|
-
*/
|
|
17
|
-
var MaterialRunboxQuotaPerSessionAlmostEndDialog = function MaterialRunboxQuotaPerSessionAlmostEndDialog(_ref) {
|
|
18
|
-
var open = _ref.open,
|
|
19
|
-
onClose = _ref.onClose;
|
|
20
|
-
var intl = useRawEliceIntl();
|
|
21
|
-
var _useEliceRunboxQuota = useEliceRunboxQuota(),
|
|
22
|
-
quotaInfo = _useEliceRunboxQuota.quotaInfo,
|
|
23
|
-
quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
|
|
24
|
-
if (quotaPerSessionInfo.isUnlimited) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
var isQuotaAlmostEnd = !quotaInfo.isUnlimited && quotaInfo.remainingQuota <= QUOTA_ALMOST_END_MINUTES;
|
|
28
|
-
var isQuotaPerSessionAlmostEnd = quotaPerSessionInfo.remainingQuota <= QUOTA_PER_SESSION_ALMOST_END_MINUTES;
|
|
29
|
-
return jsxs(Dialog, {
|
|
30
|
-
fullWidth: true,
|
|
31
|
-
maxWidth: "xs",
|
|
32
|
-
open: open,
|
|
33
|
-
onClose: onClose,
|
|
34
|
-
children: [jsx(DialogTitle, {
|
|
35
|
-
children: intl.formatMessage({
|
|
36
|
-
id: 'runbox.timer.almost_end.dialog.quota_per_session.title'
|
|
37
|
-
}, {
|
|
38
|
-
time: intl.formatNumber(QUOTA_PER_SESSION_ALMOST_END_MINUTES, {
|
|
39
|
-
style: 'unit',
|
|
40
|
-
unit: 'minute',
|
|
41
|
-
unitDisplay: 'short'
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
}), jsx(DialogContent, {
|
|
45
|
-
children: jsxs(Stack, {
|
|
46
|
-
direction: "column",
|
|
47
|
-
gap: "1.5rem",
|
|
48
|
-
children: [jsxs(Card, {
|
|
49
|
-
elevation: 0,
|
|
50
|
-
sx: {
|
|
51
|
-
bgcolor: 'background.neutral'
|
|
52
|
-
},
|
|
53
|
-
children: [jsxs(Stack, {
|
|
54
|
-
direction: "column",
|
|
55
|
-
gap: "0.5rem",
|
|
56
|
-
padding: "1rem",
|
|
57
|
-
bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
|
|
58
|
-
children: [jsx(Typography, {
|
|
59
|
-
variant: "body2",
|
|
60
|
-
fontWeight: "bold",
|
|
61
|
-
children: intl.formatMessage({
|
|
62
|
-
id: 'runbox.timer.popover.quota.title'
|
|
63
|
-
})
|
|
64
|
-
}), quotaInfo.isUnlimited ? jsx(Typography, {
|
|
65
|
-
component: "span",
|
|
66
|
-
variant: "h5",
|
|
67
|
-
fontWeight: "extraBold",
|
|
68
|
-
children: intl.formatMessage({
|
|
69
|
-
id: 'runbox.timer.unlimited'
|
|
70
|
-
})
|
|
71
|
-
}) : jsx(MaterialRunboxQuotaAmount, {
|
|
72
|
-
remainingQuota: quotaInfo.remainingQuota,
|
|
73
|
-
quota: quotaInfo.quota,
|
|
74
|
-
color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
|
|
75
|
-
})]
|
|
76
|
-
}), jsx(Divider, {}), jsxs(Stack, {
|
|
77
|
-
direction: "column",
|
|
78
|
-
gap: "0.5rem",
|
|
79
|
-
padding: "1rem",
|
|
80
|
-
bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
|
|
81
|
-
children: [jsx(Typography, {
|
|
82
|
-
variant: "body2",
|
|
83
|
-
fontWeight: "bold",
|
|
84
|
-
children: intl.formatMessage({
|
|
85
|
-
id: 'runbox.timer.popover.quota_per_session.title'
|
|
86
|
-
})
|
|
87
|
-
}), jsx(MaterialRunboxQuotaAmount, {
|
|
88
|
-
remainingQuota: quotaPerSessionInfo.remainingQuota,
|
|
89
|
-
quota: quotaPerSessionInfo.quota,
|
|
90
|
-
color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
|
|
91
|
-
})]
|
|
92
|
-
})]
|
|
93
|
-
}), jsx(Typography, {
|
|
94
|
-
variant: "body2",
|
|
95
|
-
whiteSpace: "pre-line",
|
|
96
|
-
children: intl.formatMessage({
|
|
97
|
-
id: 'runbox.timer.almost_end.dialog.quota_per_session.description'
|
|
98
|
-
})
|
|
99
|
-
})]
|
|
100
|
-
})
|
|
101
|
-
}), jsx(DialogActions, {
|
|
102
|
-
children: jsx(Button, {
|
|
103
|
-
variant: "contained",
|
|
104
|
-
color: "inherit",
|
|
105
|
-
onClick: onClose,
|
|
106
|
-
children: intl.formatMessage({
|
|
107
|
-
id: 'runbox.timer.almost_end.dialog.confirm'
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
})]
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export { MaterialRunboxQuotaPerSessionAlmostEndDialog as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface MaterialRunboxQuotaTimePartProps {
|
|
2
|
-
value: number;
|
|
3
|
-
unit: 'hour' | 'minute';
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A single `4시간` / `11분` part, with the unit rendered smaller than the number.
|
|
8
|
-
*
|
|
9
|
-
* The number and its unit are split with `formatNumberToParts` rather than by hand,
|
|
10
|
-
* because where the unit sits and how it is written differs per locale.
|
|
11
|
-
*
|
|
12
|
-
* Renders nothing when `value` is 0, so `29분` does not come out as `0시간 29분`.
|
|
13
|
-
*/
|
|
14
|
-
declare const MaterialRunboxQuotaTimePart: React.FC<MaterialRunboxQuotaTimePartProps>;
|
|
15
|
-
export default MaterialRunboxQuotaTimePart;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { Typography } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
/**
|
|
9
|
-
* A single `4시간` / `11분` part, with the unit rendered smaller than the number.
|
|
10
|
-
*
|
|
11
|
-
* The number and its unit are split with `formatNumberToParts` rather than by hand,
|
|
12
|
-
* because where the unit sits and how it is written differs per locale.
|
|
13
|
-
*
|
|
14
|
-
* Renders nothing when `value` is 0, so `29분` does not come out as `0시간 29분`.
|
|
15
|
-
*/
|
|
16
|
-
var MaterialRunboxQuotaTimePart = function MaterialRunboxQuotaTimePart(_ref) {
|
|
17
|
-
var value = _ref.value,
|
|
18
|
-
unit = _ref.unit,
|
|
19
|
-
color = _ref.color;
|
|
20
|
-
var intl = useRawEliceIntl();
|
|
21
|
-
if (value === 0) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return jsx(Typography, {
|
|
25
|
-
component: "span",
|
|
26
|
-
variant: "h5",
|
|
27
|
-
fontWeight: "extraBold",
|
|
28
|
-
color: color,
|
|
29
|
-
children: intl.formatNumberToParts(value, {
|
|
30
|
-
style: 'unit',
|
|
31
|
-
unit: unit,
|
|
32
|
-
unitDisplay: 'short'
|
|
33
|
-
}).map(function (part, index) {
|
|
34
|
-
return part.type === 'unit' ? jsx(Typography, {
|
|
35
|
-
component: "span",
|
|
36
|
-
variant: "body2",
|
|
37
|
-
fontWeight: "regular",
|
|
38
|
-
children: part.value
|
|
39
|
-
}, index) : jsx("span", {
|
|
40
|
-
children: part.value
|
|
41
|
-
}, index);
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { MaterialRunboxQuotaTimePart as default };
|