@elice/material-runbox 1.260825.0-runboxusability.1 → 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 -17
  8. package/cjs/components/material-runbox/hooks/index.d.ts +0 -2
  9. package/cjs/components/material-runbox/hooks/index.js +0 -6
  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 -19
  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 -19
  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 +77 -15
  37. package/package.json +6 -6
  38. package/cjs/components/material-runbox/hooks/useOnlineState.d.ts +0 -12
  39. package/cjs/components/material-runbox/hooks/useOnlineState.js +0 -50
  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 -88
  44. package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -11
  45. package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -32
  46. package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
  47. package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -133
  48. package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
  49. package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -42
  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 -116
  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 -117
  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/useOnlineState.d.ts +0 -12
  61. package/es/components/material-runbox/hooks/useOnlineState.js +0 -44
  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 -80
  66. package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -11
  67. package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -28
  68. package/es/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
  69. package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -129
  70. package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
  71. package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -38
  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 -112
  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 -113
  80. package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
  81. package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -46
@@ -1,42 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var material = require('@mui/material');
7
-
8
- //
9
- //
10
- //
11
- var MaterialRunboxStatusResourceItem = function MaterialRunboxStatusResourceItem(_ref) {
12
- var icon = _ref.icon,
13
- label = _ref.label,
14
- value = _ref.value;
15
- return jsxRuntime.jsxs(material.Stack, {
16
- direction: "row",
17
- alignItems: "flex-start",
18
- gap: "0.75rem",
19
- padding: "0.375rem 0.75rem",
20
- children: [jsxRuntime.jsx(material.Typography, {
21
- component: "span",
22
- display: "inline-flex",
23
- color: "text.secondary",
24
- paddingTop: "0.5rem",
25
- children: icon
26
- }), jsxRuntime.jsxs(material.Stack, {
27
- direction: "column",
28
- children: [jsxRuntime.jsx(material.Typography, {
29
- variant: "body2",
30
- fontWeight: "bold",
31
- children: label
32
- }), jsxRuntime.jsx(material.Typography, {
33
- variant: "caption",
34
- color: "text.secondary",
35
- fontFamily: "'JetBrains Mono', monospace",
36
- children: value
37
- })]
38
- })]
39
- });
40
- };
41
-
42
- exports.default = MaterialRunboxStatusResourceItem;
@@ -1,4 +0,0 @@
1
- export { default as MaterialRunboxStatusButton } from './MaterialRunboxStatusButton';
2
- export { default as MaterialRunboxStatusPopover } from './MaterialRunboxStatusPopover';
3
- export type { MaterialRunboxStatusButtonProps } from './MaterialRunboxStatusButton';
4
- export type { MaterialRunboxStatusPopoverProps } from './MaterialRunboxStatusPopover';
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- var MaterialRunboxStatusButton = require('./MaterialRunboxStatusButton.js');
4
- var MaterialRunboxStatusPopover = require('./MaterialRunboxStatusPopover.js');
5
-
6
-
7
-
8
- exports.MaterialRunboxStatusButton = MaterialRunboxStatusButton.default;
9
- exports.MaterialRunboxStatusPopover = MaterialRunboxStatusPopover.default;
@@ -1,11 +0,0 @@
1
- interface MaterialRunboxQuotaAlmostEndDialogProps {
2
- open: boolean;
3
- onClose: () => void;
4
- }
5
- /**
6
- * Warns the learner that the *total* available time is about to run out.
7
- *
8
- * Once it does, the practice ends for good — there is no reconnecting.
9
- */
10
- declare const MaterialRunboxQuotaAlmostEndDialog: React.FC<MaterialRunboxQuotaAlmostEndDialogProps>;
11
- export default MaterialRunboxQuotaAlmostEndDialog;
@@ -1,116 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var intl = require('@elice/intl');
7
- var runboxClient = require('@elice/runbox-client');
8
- var material = require('@mui/material');
9
- var useRunboxSessionEndWarning = require('../hooks/useRunboxSessionEndWarning.js');
10
- var MaterialRunboxQuotaAmount = require('./MaterialRunboxQuotaAmount.js');
11
-
12
- //
13
- //
14
- //
15
- /**
16
- * Warns the learner that the *total* available time is about to run out.
17
- *
18
- * Once it does, the practice ends for good — there is no reconnecting.
19
- */
20
- var MaterialRunboxQuotaAlmostEndDialog = function MaterialRunboxQuotaAlmostEndDialog(_ref) {
21
- var open = _ref.open,
22
- onClose = _ref.onClose;
23
- var intl$1 = intl.useRawEliceIntl();
24
- var _useEliceRunboxQuota = runboxClient.useEliceRunboxQuota(),
25
- quotaInfo = _useEliceRunboxQuota.quotaInfo,
26
- quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
27
- if (quotaInfo.isUnlimited) {
28
- return null;
29
- }
30
- var isQuotaAlmostEnd = quotaInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_ALMOST_END_MINUTES;
31
- var isQuotaPerSessionAlmostEnd = !quotaPerSessionInfo.isUnlimited && quotaPerSessionInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_PER_SESSION_ALMOST_END_MINUTES;
32
- return jsxRuntime.jsxs(material.Dialog, {
33
- fullWidth: true,
34
- maxWidth: "xs",
35
- open: open,
36
- onClose: onClose,
37
- children: [jsxRuntime.jsx(material.DialogTitle, {
38
- children: intl$1.formatMessage({
39
- id: 'runbox.timer.almost_end.dialog.quota.title'
40
- }, {
41
- time: intl$1.formatNumber(useRunboxSessionEndWarning.QUOTA_ALMOST_END_MINUTES, {
42
- style: 'unit',
43
- unit: 'minute',
44
- unitDisplay: 'short'
45
- })
46
- })
47
- }), jsxRuntime.jsx(material.DialogContent, {
48
- children: jsxRuntime.jsxs(material.Stack, {
49
- direction: "column",
50
- gap: "1.5rem",
51
- children: [jsxRuntime.jsxs(material.Card, {
52
- sx: {
53
- bgcolor: 'background.neutral'
54
- },
55
- children: [jsxRuntime.jsxs(material.Stack, {
56
- direction: "column",
57
- gap: "0.5rem",
58
- padding: "1rem",
59
- bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
60
- children: [jsxRuntime.jsx(material.Typography, {
61
- variant: "body2",
62
- fontWeight: "bold",
63
- children: intl$1.formatMessage({
64
- id: 'runbox.timer.popover.quota.title'
65
- })
66
- }), jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
67
- remainingQuota: quotaInfo.remainingQuota,
68
- quota: quotaInfo.quota,
69
- color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
70
- })]
71
- }), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(material.Stack, {
72
- direction: "column",
73
- gap: "0.5rem",
74
- padding: "1rem",
75
- bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
76
- children: [jsxRuntime.jsx(material.Typography, {
77
- variant: "body2",
78
- fontWeight: "bold",
79
- children: intl$1.formatMessage({
80
- id: 'runbox.timer.popover.quota_per_session.title'
81
- })
82
- }), quotaPerSessionInfo.isUnlimited ? jsxRuntime.jsx(material.Typography, {
83
- component: "span",
84
- variant: "h5",
85
- fontWeight: "extraBold",
86
- children: intl$1.formatMessage({
87
- id: 'runbox.timer.unlimited'
88
- })
89
- }) : jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
90
- remainingQuota: quotaPerSessionInfo.remainingQuota,
91
- quota: quotaPerSessionInfo.quota,
92
- color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
93
- })]
94
- })]
95
- }), jsxRuntime.jsx(material.Typography, {
96
- variant: "body2",
97
- whiteSpace: "pre-line",
98
- children: intl$1.formatMessage({
99
- id: 'runbox.timer.almost_end.dialog.quota.description'
100
- })
101
- })]
102
- })
103
- }), jsxRuntime.jsx(material.DialogActions, {
104
- children: jsxRuntime.jsx(material.Button, {
105
- variant: "contained",
106
- color: "inherit",
107
- onClick: onClose,
108
- children: intl$1.formatMessage({
109
- id: 'runbox.timer.almost_end.dialog.confirm'
110
- })
111
- })
112
- })]
113
- });
114
- };
115
-
116
- exports.default = MaterialRunboxQuotaAlmostEndDialog;
@@ -1,13 +0,0 @@
1
- export interface MaterialRunboxQuotaAmountProps {
2
- /** Remaining time, in minutes. */
3
- remainingQuota: number;
4
- /** Total granted time, in minutes. */
5
- quota: number;
6
- /** Color of the remaining time. */
7
- color?: string;
8
- }
9
- /**
10
- * Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
11
- */
12
- declare const MaterialRunboxQuotaAmount: React.FC<MaterialRunboxQuotaAmountProps>;
13
- export default MaterialRunboxQuotaAmount;
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var intl = require('@elice/intl');
7
- var material = require('@mui/material');
8
- var MaterialRunboxQuotaTimePart = require('./MaterialRunboxQuotaTimePart.js');
9
- var time = require('../../../utils/time.js');
10
-
11
- //
12
- //
13
- //
14
- /**
15
- * Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
16
- */
17
- var MaterialRunboxQuotaAmount = function MaterialRunboxQuotaAmount(_ref) {
18
- var remainingQuota = _ref.remainingQuota,
19
- quota = _ref.quota,
20
- color = _ref.color;
21
- var intl$1 = intl.useRawEliceIntl();
22
- var _getTimeParts = time.getTimeParts(remainingQuota * 60),
23
- remainingHours = _getTimeParts.hours,
24
- remainingMinutes = _getTimeParts.minutes;
25
- var _getTimeParts2 = time.getTimeParts(quota * 60),
26
- totalHours = _getTimeParts2.hours,
27
- totalMinutes = _getTimeParts2.minutes;
28
- return jsxRuntime.jsxs(material.Typography, {
29
- variant: "body2",
30
- children: [jsxRuntime.jsxs(material.Stack, {
31
- component: "span",
32
- display: "inline-flex",
33
- direction: "row",
34
- gap: "0.25rem",
35
- children: [jsxRuntime.jsx(MaterialRunboxQuotaTimePart.default, {
36
- value: remainingHours,
37
- unit: "hour",
38
- color: color
39
- }), jsxRuntime.jsx(MaterialRunboxQuotaTimePart.default, {
40
- value: remainingMinutes,
41
- unit: "minute",
42
- color: color
43
- })]
44
- }), " / ", [totalHours > 0 ? intl$1.formatNumber(totalHours, {
45
- style: 'unit',
46
- unit: 'hour',
47
- unitDisplay: 'short'
48
- }) : null, totalMinutes > 0 ? intl$1.formatNumber(totalMinutes, {
49
- style: 'unit',
50
- unit: 'minute',
51
- unitDisplay: 'short'
52
- }) : null].filter(Boolean).join(' ')]
53
- });
54
- };
55
-
56
- exports.default = MaterialRunboxQuotaAmount;
@@ -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,117 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var intl = require('@elice/intl');
7
- var runboxClient = require('@elice/runbox-client');
8
- var material = require('@mui/material');
9
- var useRunboxSessionEndWarning = require('../hooks/useRunboxSessionEndWarning.js');
10
- var MaterialRunboxQuotaAmount = require('./MaterialRunboxQuotaAmount.js');
11
-
12
- //
13
- //
14
- //
15
- /**
16
- * Warns the learner that the time granted to *this connection* is about to run out.
17
- *
18
- * Unlike the total quota, the learner can reconnect and keep going as long as total
19
- * time is left — so this dialog is about saving work, not about the practice ending.
20
- */
21
- var MaterialRunboxQuotaPerSessionAlmostEndDialog = function MaterialRunboxQuotaPerSessionAlmostEndDialog(_ref) {
22
- var open = _ref.open,
23
- onClose = _ref.onClose;
24
- var intl$1 = intl.useRawEliceIntl();
25
- var _useEliceRunboxQuota = runboxClient.useEliceRunboxQuota(),
26
- quotaInfo = _useEliceRunboxQuota.quotaInfo,
27
- quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
28
- if (quotaPerSessionInfo.isUnlimited) {
29
- return null;
30
- }
31
- var isQuotaAlmostEnd = !quotaInfo.isUnlimited && quotaInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_ALMOST_END_MINUTES;
32
- var isQuotaPerSessionAlmostEnd = quotaPerSessionInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_PER_SESSION_ALMOST_END_MINUTES;
33
- return jsxRuntime.jsxs(material.Dialog, {
34
- fullWidth: true,
35
- maxWidth: "xs",
36
- open: open,
37
- onClose: onClose,
38
- children: [jsxRuntime.jsx(material.DialogTitle, {
39
- children: intl$1.formatMessage({
40
- id: 'runbox.timer.almost_end.dialog.quota_per_session.title'
41
- }, {
42
- time: intl$1.formatNumber(useRunboxSessionEndWarning.QUOTA_PER_SESSION_ALMOST_END_MINUTES, {
43
- style: 'unit',
44
- unit: 'minute',
45
- unitDisplay: 'short'
46
- })
47
- })
48
- }), jsxRuntime.jsx(material.DialogContent, {
49
- children: jsxRuntime.jsxs(material.Stack, {
50
- direction: "column",
51
- gap: "1.5rem",
52
- children: [jsxRuntime.jsxs(material.Card, {
53
- sx: {
54
- bgcolor: 'background.neutral'
55
- },
56
- children: [jsxRuntime.jsxs(material.Stack, {
57
- direction: "column",
58
- gap: "0.5rem",
59
- padding: "1rem",
60
- bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
61
- children: [jsxRuntime.jsx(material.Typography, {
62
- variant: "body2",
63
- fontWeight: "bold",
64
- children: intl$1.formatMessage({
65
- id: 'runbox.timer.popover.quota.title'
66
- })
67
- }), quotaInfo.isUnlimited ? jsxRuntime.jsx(material.Typography, {
68
- component: "span",
69
- variant: "h5",
70
- fontWeight: "extraBold",
71
- children: intl$1.formatMessage({
72
- id: 'runbox.timer.unlimited'
73
- })
74
- }) : jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
75
- remainingQuota: quotaInfo.remainingQuota,
76
- quota: quotaInfo.quota,
77
- color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
78
- })]
79
- }), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(material.Stack, {
80
- direction: "column",
81
- gap: "0.5rem",
82
- padding: "1rem",
83
- bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
84
- children: [jsxRuntime.jsx(material.Typography, {
85
- variant: "body2",
86
- fontWeight: "bold",
87
- children: intl$1.formatMessage({
88
- id: 'runbox.timer.popover.quota_per_session.title'
89
- })
90
- }), jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
91
- remainingQuota: quotaPerSessionInfo.remainingQuota,
92
- quota: quotaPerSessionInfo.quota,
93
- color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
94
- })]
95
- })]
96
- }), jsxRuntime.jsx(material.Typography, {
97
- variant: "body2",
98
- whiteSpace: "pre-line",
99
- children: intl$1.formatMessage({
100
- id: 'runbox.timer.almost_end.dialog.quota_per_session.description'
101
- })
102
- })]
103
- })
104
- }), jsxRuntime.jsx(material.DialogActions, {
105
- children: jsxRuntime.jsx(material.Button, {
106
- variant: "contained",
107
- color: "inherit",
108
- onClick: onClose,
109
- children: intl$1.formatMessage({
110
- id: 'runbox.timer.almost_end.dialog.confirm'
111
- })
112
- })
113
- })]
114
- });
115
- };
116
-
117
- exports.default = MaterialRunboxQuotaPerSessionAlmostEndDialog;
@@ -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,50 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var intl = require('@elice/intl');
7
- var material = require('@mui/material');
8
-
9
- //
10
- //
11
- //
12
- /**
13
- * A single `4시간` / `11분` part, with the unit rendered smaller than the number.
14
- *
15
- * The number and its unit are split with `formatNumberToParts` rather than by hand,
16
- * because where the unit sits and how it is written differs per locale.
17
- *
18
- * Renders nothing when `value` is 0, so `29분` does not come out as `0시간 29분`.
19
- */
20
- var MaterialRunboxQuotaTimePart = function MaterialRunboxQuotaTimePart(_ref) {
21
- var value = _ref.value,
22
- unit = _ref.unit,
23
- color = _ref.color;
24
- var intl$1 = intl.useRawEliceIntl();
25
- if (value === 0) {
26
- return null;
27
- }
28
- return jsxRuntime.jsx(material.Typography, {
29
- component: "span",
30
- variant: "h5",
31
- fontWeight: "extraBold",
32
- color: color,
33
- children: intl$1.formatNumberToParts(value, {
34
- style: 'unit',
35
- unit: unit,
36
- unitDisplay: 'short'
37
- }).map(function (part, index) {
38
- return part.type === 'unit' ? jsxRuntime.jsx(material.Typography, {
39
- component: "span",
40
- variant: "body2",
41
- fontWeight: "regular",
42
- children: part.value
43
- }, index) : jsxRuntime.jsx("span", {
44
- children: part.value
45
- }, index);
46
- })
47
- });
48
- };
49
-
50
- exports.default = MaterialRunboxQuotaTimePart;
@@ -1,12 +0,0 @@
1
- /**
2
- * Whether the browser currently has a network connection.
3
- *
4
- * NOTICE: this deliberately does not use `react-use`'s `useNetworkState`.
5
- * That hook only exists in react-use v17, and consumers of this package do not
6
- * agree on the major — elice-web still resolves v13, which breaks the build at
7
- * link time. Reading `navigator.onLine` keeps this working on both.
8
- *
9
- * `undefined` means "not known yet" (server render, or no `navigator`), which
10
- * callers should treat as online rather than as offline.
11
- */
12
- export declare const useOnlineState: () => boolean | undefined;
@@ -1,44 +0,0 @@
1
- import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import React from 'react';
3
-
4
- //
5
- //
6
- //
7
- /**
8
- * Whether the browser currently has a network connection.
9
- *
10
- * NOTICE: this deliberately does not use `react-use`'s `useNetworkState`.
11
- * That hook only exists in react-use v17, and consumers of this package do not
12
- * agree on the major — elice-web still resolves v13, which breaks the build at
13
- * link time. Reading `navigator.onLine` keeps this working on both.
14
- *
15
- * `undefined` means "not known yet" (server render, or no `navigator`), which
16
- * callers should treat as online rather than as offline.
17
- */
18
- var useOnlineState = function useOnlineState() {
19
- var _React$useState = React.useState(function () {
20
- return typeof navigator === 'undefined' ? undefined : navigator.onLine;
21
- }),
22
- _React$useState2 = _slicedToArray(_React$useState, 2),
23
- online = _React$useState2[0],
24
- setOnline = _React$useState2[1];
25
- React.useEffect(function () {
26
- var handleOnline = function handleOnline() {
27
- return setOnline(true);
28
- };
29
- var handleOffline = function handleOffline() {
30
- return setOnline(false);
31
- };
32
- window.addEventListener('online', handleOnline);
33
- window.addEventListener('offline', handleOffline);
34
- // Catch a change that happened between the initial state and this effect.
35
- setOnline(navigator.onLine);
36
- return function () {
37
- window.removeEventListener('online', handleOnline);
38
- window.removeEventListener('offline', handleOffline);
39
- };
40
- }, []);
41
- return online;
42
- };
43
-
44
- export { useOnlineState };
@@ -1,18 +0,0 @@
1
- export type RunboxSessionEndWarning = 'quota' | 'quotaPerSession';
2
- interface UseRunboxSessionEndWarningParams {
3
- runboxId: string;
4
- /**
5
- * Suppress every warning.
6
- * @default false
7
- */
8
- disabled?: boolean;
9
- }
10
- interface UseRunboxSessionEndWarningReturn {
11
- warning: RunboxSessionEndWarning | null;
12
- /** Marks the current warning as seen, which is what closes it. */
13
- dismiss: () => void;
14
- }
15
- export declare const QUOTA_ALMOST_END_MINUTES = 30;
16
- export declare const QUOTA_PER_SESSION_ALMOST_END_MINUTES = 10;
17
- export declare function useRunboxSessionEndWarning({ runboxId, disabled, }: UseRunboxSessionEndWarningParams): UseRunboxSessionEndWarningReturn;
18
- export {};
@@ -1,63 +0,0 @@
1
- import { slicedToArray as _slicedToArray, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { useSessionStorage } from 'react-use';
3
- import { useEliceRunboxQuota } from '@elice/runbox-client';
4
-
5
- //
6
- //
7
- //
8
- var QUOTA_ALMOST_END_MINUTES = 30;
9
- var QUOTA_PER_SESSION_ALMOST_END_MINUTES = 10;
10
- var WAS_WARNED_STORAGE_KEY = 'MaterialRunboxSessionEndWarning.wasWarned';
11
- //
12
- //
13
- //
14
- /** Remaining minutes while the almost-end warning is due, `null` when it is not. */
15
- function getAlmostEndRemaining(quotaInfo, thresholdMinutes) {
16
- var seen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
17
- if (seen || quotaInfo.isUnlimited || quotaInfo.remainingQuota > thresholdMinutes) {
18
- return null;
19
- }
20
- return quotaInfo.remainingQuota;
21
- }
22
- /** The due warning that runs out soonest, `null` when neither is due. */
23
- function getSessionEndWarning(quotaInfo, quotaPerSessionInfo, seen) {
24
- var quota = getAlmostEndRemaining(quotaInfo, QUOTA_ALMOST_END_MINUTES, seen.quota);
25
- var quotaPerSession = getAlmostEndRemaining(quotaPerSessionInfo, QUOTA_PER_SESSION_ALMOST_END_MINUTES, seen.quotaPerSession);
26
- if (quota === null) {
27
- return quotaPerSession === null ? null : 'quotaPerSession';
28
- }
29
- if (quotaPerSession === null) {
30
- return 'quota';
31
- }
32
- return quota < quotaPerSession ? 'quota' : 'quotaPerSession';
33
- }
34
- //
35
- //
36
- //
37
- function useRunboxSessionEndWarning(_ref) {
38
- var runboxId = _ref.runboxId,
39
- _ref$disabled = _ref.disabled,
40
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
41
- var _a;
42
- var _useEliceRunboxQuota = useEliceRunboxQuota(),
43
- quotaInfo = _useEliceRunboxQuota.quotaInfo,
44
- quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
45
- var _useSessionStorage = useSessionStorage(WAS_WARNED_STORAGE_KEY, {}),
46
- _useSessionStorage2 = _slicedToArray(_useSessionStorage, 2),
47
- wasWarned = _useSessionStorage2[0],
48
- setWasWarned = _useSessionStorage2[1];
49
- var seen = (_a = wasWarned === null || wasWarned === void 0 ? void 0 : wasWarned[runboxId]) !== null && _a !== void 0 ? _a : {};
50
- var warning = disabled ? null : getSessionEndWarning(quotaInfo, quotaPerSessionInfo, seen);
51
- var dismiss = function dismiss() {
52
- if (warning === null) {
53
- return;
54
- }
55
- setWasWarned(Object.assign(Object.assign({}, wasWarned), _defineProperty({}, runboxId, Object.assign(Object.assign({}, seen), _defineProperty({}, warning, true)))));
56
- };
57
- return {
58
- warning: warning,
59
- dismiss: dismiss
60
- };
61
- }
62
-
63
- export { QUOTA_ALMOST_END_MINUTES, QUOTA_PER_SESSION_ALMOST_END_MINUTES, useRunboxSessionEndWarning };
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- export interface MaterialRunboxStatusButtonProps {
3
- /**
4
- * Bottom action slot of the popover.
5
- *
6
- * NOTICE: the "실습 환경 초기화" button is out of scope for PLAT-4181.
7
- * PLAT-4184 injects it here.
8
- */
9
- bottomAction?: React.ReactNode;
10
- }
11
- /**
12
- * Opens the runbox connection/resource status popover.
13
- *
14
- * Replaces the always-visible resource stats of the removed footer,
15
- * so the numbers are only shown on explicit request. (`[R-5]` `[R-6]`)
16
- */
17
- declare const MaterialRunboxStatusButton: React.FC<MaterialRunboxStatusButtonProps>;
18
- export default MaterialRunboxStatusButton;