@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.
Files changed (81) hide show
  1. package/cjs/assets/runbox_logo.png.js +7 -0
  2. package/cjs/components/material-runbox/MaterialRunboxContent.js +2 -1
  3. package/cjs/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
  4. package/cjs/components/material-runbox/MaterialRunboxFooter.js +64 -0
  5. package/cjs/components/material-runbox/MaterialRunboxHeader.js +29 -12
  6. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
  7. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +1 -22
  8. package/cjs/components/material-runbox/hooks/index.d.ts +0 -2
  9. package/cjs/components/material-runbox/hooks/index.js +0 -10
  10. package/cjs/components/material-runbox/locales/en.json.js +1 -1
  11. package/cjs/components/material-runbox/locales/ja.json.js +1 -1
  12. package/cjs/components/material-runbox/locales/ko.json.js +1 -1
  13. package/cjs/components/material-runbox/locales/th.json.js +1 -1
  14. package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
  15. package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +90 -0
  16. package/cjs/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
  17. package/cjs/components/material-runbox/timer/MaterialRunboxTimer.js +16 -20
  18. package/cjs/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +81 -21
  19. package/es/assets/runbox_logo.png.js +3 -0
  20. package/es/components/material-runbox/MaterialRunboxContent.js +2 -1
  21. package/es/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
  22. package/es/components/material-runbox/MaterialRunboxFooter.js +56 -0
  23. package/es/components/material-runbox/MaterialRunboxHeader.js +30 -13
  24. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
  25. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +3 -24
  26. package/es/components/material-runbox/hooks/index.d.ts +0 -2
  27. package/es/components/material-runbox/hooks/index.js +0 -2
  28. package/es/components/material-runbox/locales/en.json.js +1 -1
  29. package/es/components/material-runbox/locales/ja.json.js +1 -1
  30. package/es/components/material-runbox/locales/ko.json.js +1 -1
  31. package/es/components/material-runbox/locales/th.json.js +1 -1
  32. package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
  33. package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +86 -0
  34. package/es/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
  35. package/es/components/material-runbox/timer/MaterialRunboxTimer.js +15 -19
  36. package/es/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +78 -18
  37. package/package.json +6 -6
  38. package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +0 -14
  39. package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.js +0 -65
  40. package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
  41. package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -67
  42. package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
  43. package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -89
  44. package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -12
  45. package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -35
  46. package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
  47. package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -142
  48. package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
  49. package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -41
  50. package/cjs/components/material-runbox/status/index.d.ts +0 -4
  51. package/cjs/components/material-runbox/status/index.js +0 -9
  52. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
  53. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -117
  54. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
  55. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -56
  56. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
  57. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -118
  58. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
  59. package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -50
  60. package/es/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +0 -14
  61. package/es/components/material-runbox/hooks/useRunboxNetworkStatus.js +0 -59
  62. package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
  63. package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -63
  64. package/es/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
  65. package/es/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -81
  66. package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -12
  67. package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -31
  68. package/es/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
  69. package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -138
  70. package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
  71. package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -37
  72. package/es/components/material-runbox/status/index.d.ts +0 -4
  73. package/es/components/material-runbox/status/index.js +0 -2
  74. package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
  75. package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -113
  76. package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
  77. package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -52
  78. package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
  79. package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -114
  80. package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
  81. 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 };
@@ -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 };