@nualang/nualang-ui-components 0.1.1220 → 0.1.1221

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.
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = SelectAssignmentTypeDialog;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _material = require("@mui/material");
9
+ var _Assignment = _interopRequireDefault(require("@mui/icons-material/Assignment"));
10
+ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
11
+ var _VideoCall = _interopRequireDefault(require("@mui/icons-material/VideoCall"));
12
+ var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
13
+ var _useTheme = _interopRequireDefault(require("@mui/material/styles/useTheme"));
14
+ var _mui = require("tss-react/mui");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ const useStyles = (0, _mui.makeStyles)()(theme => ({
18
+ div: {
19
+ textAlign: "center",
20
+ borderRadius: theme.shape.borderRadius,
21
+ border: `2px solid ${theme.palette.divider}`,
22
+ padding: theme.spacing(2),
23
+ "&:hover": {
24
+ cursor: "pointer",
25
+ opacity: 0.8
26
+ }
27
+ },
28
+ paper: {
29
+ paddingTop: `env(safe-area-inset-top)`,
30
+ paddingBottom: `env(safe-area-inset-bottom)`,
31
+ paddingLeft: `env(safe-area-inset-left)`,
32
+ paddingRight: `env(safe-area-inset-right)`
33
+ },
34
+ button: {
35
+ marginBottom: theme.spacing(),
36
+ marginRight: theme.spacing(),
37
+ maxWidth: 300,
38
+ height: 36.5
39
+ }
40
+ }));
41
+ function SelectAssignmentTypeDialog({
42
+ t = text => text,
43
+ open,
44
+ handleClose,
45
+ dialogTitle,
46
+ classrooms,
47
+ handleInputChange,
48
+ selectedClassroom,
49
+ isClassroomView,
50
+ handleSelectExercises,
51
+ handleSelectDiscuss
52
+ }) {
53
+ const {
54
+ classes
55
+ } = useStyles();
56
+ const theme = (0, _useTheme.default)();
57
+ const fullScreen = (0, _useMediaQuery.default)(theme.breakpoints.down("md"));
58
+ const classroomsList = classrooms.map(classroom => {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
60
+ value: classroom.classroomId,
61
+ children: classroom.classroomName
62
+ }, classroom.classroomId);
63
+ });
64
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
65
+ open: open,
66
+ onClose: handleClose,
67
+ dialogTitle: dialogTitle,
68
+ maxWidth: "lg",
69
+ fullScreen: fullScreen,
70
+ fullWidth: true,
71
+ "aria-label": dialogTitle,
72
+ classes: {
73
+ paper: classes.paper
74
+ },
75
+ children: [dialogTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogTitle, {
76
+ sx: {
77
+ fontWeight: 'bold'
78
+ },
79
+ children: dialogTitle
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.DialogContent, {
81
+ children: [!isClassroomView && classrooms.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
82
+ select: true,
83
+ id: "classrooms",
84
+ name: "classrooms",
85
+ "data-cy": "classrooms",
86
+ label: t("select_a_classroom"),
87
+ value: selectedClassroom,
88
+ onChange: handleInputChange,
89
+ margin: "normal",
90
+ variant: "outlined",
91
+ fullWidth: true,
92
+ required: true,
93
+ children: classroomsList
94
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
95
+ container: true,
96
+ spacing: 2,
97
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
98
+ item: true,
99
+ xs: 12,
100
+ md: 6,
101
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
102
+ className: classes.div,
103
+ onClick: handleSelectExercises,
104
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
105
+ style: {
106
+ marginBottom: theme.spacing(2)
107
+ },
108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
109
+ variant: "h4",
110
+ sx: {
111
+ fontWeight: 'bold'
112
+ },
113
+ children: t('assign_exercises')
114
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Assignment.default, {
115
+ sx: theme => ({
116
+ width: "100%",
117
+ height: "auto",
118
+ maxWidth: 130,
119
+ color: theme.palette.primary.main
120
+ })
121
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
122
+ variant: "subtitle1",
123
+ children: t('assign_exercises_desc')
124
+ })]
125
+ })
126
+ })
127
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
128
+ item: true,
129
+ xs: 12,
130
+ md: 6,
131
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
132
+ className: classes.div,
133
+ onClick: handleSelectDiscuss,
134
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
135
+ style: {
136
+ marginBottom: theme.spacing(2)
137
+ },
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
139
+ variant: "h4",
140
+ sx: {
141
+ fontWeight: 'bold'
142
+ },
143
+ children: t('assign_discuss')
144
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoCall.default, {
145
+ sx: theme => ({
146
+ width: "100%",
147
+ height: "auto",
148
+ maxWidth: 130,
149
+ color: theme.palette.primary.main
150
+ })
151
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
152
+ variant: "subtitle1",
153
+ children: t('assign_discuss_desc')
154
+ })]
155
+ })
156
+ })
157
+ })]
158
+ })]
159
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogActions, {
160
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
161
+ className: classes.button,
162
+ onClick: handleClose,
163
+ color: "primary",
164
+ endIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Close.default, {}),
165
+ variant: "outlined",
166
+ children: t("cancel")
167
+ })
168
+ })]
169
+ });
170
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "SelectAssignmentTypeDialog",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SelectAssignmentTypeDialog.js"
6
+ }
7
+
@@ -63,9 +63,9 @@ function useRecognition(props = {}) {
63
63
  const serverErrorRef = (0, _react.useRef)();
64
64
  async function loadModule() {
65
65
  try {
66
- await audioContextRef.current.audioWorklet.addModule(`/worklets/recording-processor.js`);
66
+ await audioContextRef.current.audioWorklet.addModule(`/worklets/recording-processor-v2.js`);
67
67
  } catch (e) {
68
- console.error(`Failed to load module /worklets/recording-processor.js`);
68
+ console.error(`Failed to load module /worklets/recording-processor-v2.js`);
69
69
  throw e;
70
70
  }
71
71
  }
@@ -176,7 +176,7 @@ function useRecognition(props = {}) {
176
176
  streamRef.current = stream;
177
177
  audioInputRef.current = audioContextRef.current.createMediaStreamSource(stream);
178
178
  serverErrorRef.current = null;
179
- processorRef.current = new AudioWorkletNode(audioContextRef.current, "recording-processor");
179
+ processorRef.current = new AudioWorkletNode(audioContextRef.current, "recording-processor-v2");
180
180
  processorRef.current.connect(audioContextRef.current.destination);
181
181
  audioContextRef.current.resume();
182
182
  audioInputRef.current.connect(processorRef.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1220",
3
+ "version": "0.1.1221",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",