@nualang/nualang-ui-components 0.1.1194 → 0.1.1196
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/dist/Dialogs/ReportProblem/ReportProblem.js +4 -4
- package/dist/Dialogs/UploadVideo/UploadVideo.js +3 -2
- package/dist/Screens/Courses/ViewCourse/ViewCourse.js +10 -2
- package/dist/Screens/Courses/ViewCourse/ViewTopic/ViewTopic.js +10 -2
- package/dist/Screens/GenerateAudio/GenerateAudio.js +36 -4
- package/package.json +1 -1
|
@@ -42,9 +42,9 @@ function ReportProblem({
|
|
|
42
42
|
description,
|
|
43
43
|
type
|
|
44
44
|
} = problem;
|
|
45
|
-
const
|
|
46
|
-
const isShareAudioAvailable =
|
|
47
|
-
const isScreenshotAvailable =
|
|
45
|
+
const isTechnicalProblem = type === "technical_problem";
|
|
46
|
+
const isShareAudioAvailable = isTechnicalProblem && audioBlob;
|
|
47
|
+
const isScreenshotAvailable = isTechnicalProblem && screenshot;
|
|
48
48
|
(0, _react.useEffect)(() => {
|
|
49
49
|
if (type && description.trim().length > 0) {
|
|
50
50
|
setEnableButton(true);
|
|
@@ -226,7 +226,7 @@ function ReportProblem({
|
|
|
226
226
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
227
227
|
fontSize: 14
|
|
228
228
|
}, t("share_audio"))
|
|
229
|
-
}))),
|
|
229
|
+
}))), isTechnicalProblem && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
230
230
|
item: true,
|
|
231
231
|
xs: 12
|
|
232
232
|
}, /*#__PURE__*/_react.default.createElement(_material.FormGroup, null, /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, {
|
|
@@ -26,12 +26,13 @@ function UploadVideo({
|
|
|
26
26
|
open,
|
|
27
27
|
handleClose,
|
|
28
28
|
onSubmit,
|
|
29
|
-
loading
|
|
29
|
+
loading,
|
|
30
|
+
video,
|
|
31
|
+
setVideo
|
|
30
32
|
}) {
|
|
31
33
|
const {
|
|
32
34
|
classes
|
|
33
35
|
} = useStyles();
|
|
34
|
-
const [video, setVideo] = (0, _react.useState)();
|
|
35
36
|
const [errors, setErrors] = (0, _react.useState)([]);
|
|
36
37
|
const [isVideoSubmitting, setIsVideoSubmitting] = (0, _react.useState)(false);
|
|
37
38
|
const handleSubmit = async () => {
|
|
@@ -130,7 +130,9 @@ function OverflowMenu({
|
|
|
130
130
|
loading,
|
|
131
131
|
verificationStatus,
|
|
132
132
|
handleUploadVideo,
|
|
133
|
-
isTeacher
|
|
133
|
+
isTeacher,
|
|
134
|
+
video,
|
|
135
|
+
setVideo
|
|
134
136
|
}) {
|
|
135
137
|
const [isShareDrawerOpen, setIsShareDrawerOpen] = (0, _react.useState)(false);
|
|
136
138
|
const [isUploadVideoOpen, setIsUploadVideoOpen] = (0, _react.useState)(false);
|
|
@@ -230,6 +232,8 @@ function OverflowMenu({
|
|
|
230
232
|
open: isUploadVideoOpen,
|
|
231
233
|
onSubmit: handleUploadVideo,
|
|
232
234
|
loading: loading,
|
|
235
|
+
video: video,
|
|
236
|
+
setVideo: setVideo,
|
|
233
237
|
handleClose: () => setIsUploadVideoOpen(false)
|
|
234
238
|
}));
|
|
235
239
|
}
|
|
@@ -313,6 +317,7 @@ function Course({
|
|
|
313
317
|
const [pageNumber, setPageNumber] = (0, _react.useState)(1);
|
|
314
318
|
const [scale, setScale] = (0, _react.useState)(1);
|
|
315
319
|
const [animatePlayVideo, setAnimatePlayVideo] = (0, _react.useState)(true);
|
|
320
|
+
const [video, setVideo] = (0, _react.useState)();
|
|
316
321
|
const handleUploadSubmit = async () => {
|
|
317
322
|
setIsSubmitting(true);
|
|
318
323
|
try {
|
|
@@ -596,6 +601,7 @@ function Course({
|
|
|
596
601
|
const confirmed = await confirm(t("delete_video"), t("delete_video_confirmation"));
|
|
597
602
|
if (confirmed) {
|
|
598
603
|
await handleDeleteCourseVideo(videoUrl);
|
|
604
|
+
setVideo(null);
|
|
599
605
|
handleCloseMenu();
|
|
600
606
|
}
|
|
601
607
|
};
|
|
@@ -882,7 +888,9 @@ function Course({
|
|
|
882
888
|
gameAward: gameAward,
|
|
883
889
|
loading: loading,
|
|
884
890
|
handleUploadVideo: handleUploadVideo,
|
|
885
|
-
isTeacher: !isStudent
|
|
891
|
+
isTeacher: !isStudent,
|
|
892
|
+
video: video,
|
|
893
|
+
setVideo: setVideo
|
|
886
894
|
}), /*#__PURE__*/_react.default.createElement(_UpgradeSubscription.default, {
|
|
887
895
|
key: "UpgradeSubscription",
|
|
888
896
|
t: t,
|
|
@@ -275,7 +275,9 @@ function OverflowMenu({
|
|
|
275
275
|
deletePDF,
|
|
276
276
|
verificationStatus,
|
|
277
277
|
handleClickOpenUpload,
|
|
278
|
-
isTeacher
|
|
278
|
+
isTeacher,
|
|
279
|
+
video,
|
|
280
|
+
setVideo
|
|
279
281
|
}) {
|
|
280
282
|
const [isShareDrawerOpen, setIsShareDrawerOpen] = (0, _react.useState)(false);
|
|
281
283
|
const [isUploadVideoOpen, setIsUploadVideoOpen] = (0, _react.useState)(false);
|
|
@@ -365,6 +367,8 @@ function OverflowMenu({
|
|
|
365
367
|
open: isUploadVideoOpen,
|
|
366
368
|
onSubmit: handleUploadVideo,
|
|
367
369
|
loading: loading,
|
|
370
|
+
video: video,
|
|
371
|
+
setVideo: setVideo,
|
|
368
372
|
handleClose: () => setIsUploadVideoOpen(false)
|
|
369
373
|
}));
|
|
370
374
|
}
|
|
@@ -547,6 +551,7 @@ function Topic({
|
|
|
547
551
|
const [pageNumber, setPageNumber] = (0, _react.useState)(1);
|
|
548
552
|
const [scale, setScale] = (0, _react.useState)(1);
|
|
549
553
|
const [animatePlayVideo, setAnimatePlayVideo] = (0, _react.useState)(true);
|
|
554
|
+
const [video, setVideo] = (0, _react.useState)();
|
|
550
555
|
const [topicCompletion, setTopicCompletion] = (0, _react.useState)({
|
|
551
556
|
completed: 0,
|
|
552
557
|
total: 0,
|
|
@@ -577,6 +582,7 @@ function Topic({
|
|
|
577
582
|
const confirmed = await confirm(t("delete_video"), t("delete_video_confirmation"));
|
|
578
583
|
if (confirmed) {
|
|
579
584
|
await handleDeleteTopicVideo(sectionId, topicId, videoUrl);
|
|
585
|
+
setVideo(null);
|
|
580
586
|
handleCloseMenu();
|
|
581
587
|
}
|
|
582
588
|
};
|
|
@@ -1212,7 +1218,9 @@ function Topic({
|
|
|
1212
1218
|
handleUpdateTopic: handleUpdateTopic,
|
|
1213
1219
|
handleUploadVideo: handleUploadVideo,
|
|
1214
1220
|
deleteTopicVideo: deleteTopicVideo,
|
|
1215
|
-
isTeacher: !isStudent
|
|
1221
|
+
isTeacher: !isStudent,
|
|
1222
|
+
video: video,
|
|
1223
|
+
setVideo: setVideo
|
|
1216
1224
|
}), /*#__PURE__*/_react.default.createElement(_ResponsiveDialog.default, {
|
|
1217
1225
|
open: isUploadPdfOpen,
|
|
1218
1226
|
dialogTitle: t("upload_pdf"),
|
|
@@ -27,6 +27,7 @@ var _Delete = _interopRequireDefault(require("@mui/icons-material/Delete"));
|
|
|
27
27
|
var _Edit = _interopRequireDefault(require("@mui/icons-material/Edit"));
|
|
28
28
|
var _RecordVoiceOver = _interopRequireDefault(require("@mui/icons-material/RecordVoiceOver"));
|
|
29
29
|
var _Speed = _interopRequireDefault(require("@mui/icons-material/Speed"));
|
|
30
|
+
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
30
31
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
31
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
32
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -631,7 +632,9 @@ function GenerateAudio({
|
|
|
631
632
|
langChar,
|
|
632
633
|
downloadAudio,
|
|
633
634
|
audioUrl,
|
|
634
|
-
openSnackbar
|
|
635
|
+
openSnackbar,
|
|
636
|
+
generateTxt,
|
|
637
|
+
setGenerateTxt
|
|
635
638
|
}) {
|
|
636
639
|
const [learnLang, setLearnLang] = (0, _react.useState)("english");
|
|
637
640
|
const [filteredVoices, setFilteredVoices] = (0, _react.useState)([]);
|
|
@@ -882,6 +885,7 @@ function GenerateAudio({
|
|
|
882
885
|
};
|
|
883
886
|
const handleChange = (event, newValue) => {
|
|
884
887
|
setShowCSV(newValue);
|
|
888
|
+
setGenerateTxt(false);
|
|
885
889
|
};
|
|
886
890
|
const downloadCSV = (text, filename) => {
|
|
887
891
|
const element = document.createElement("a");
|
|
@@ -958,6 +962,11 @@ function GenerateAudio({
|
|
|
958
962
|
openSnackbar(`Unsupported audio type for phrase: "${phrase}"`, "error");
|
|
959
963
|
continue;
|
|
960
964
|
}
|
|
965
|
+
if (generateTxt) {
|
|
966
|
+
const fileNameWithoutExtension = row.fileName.replace(".mp3", "");
|
|
967
|
+
const txtContent = `${phrase}\n`;
|
|
968
|
+
folder.file(`${fileNameWithoutExtension}.txt`, txtContent);
|
|
969
|
+
}
|
|
961
970
|
if (fileNameCount[fileNameWithExtension]) {
|
|
962
971
|
fileNameCount[fileNameWithExtension] += 1;
|
|
963
972
|
const baseName = fileNameWithExtension.replace(".mp3", "");
|
|
@@ -1258,7 +1267,18 @@ function GenerateAudio({
|
|
|
1258
1267
|
sx: {
|
|
1259
1268
|
marginBottom: 2
|
|
1260
1269
|
}
|
|
1261
|
-
}, t("download_audio"))
|
|
1270
|
+
}, t("download_audio")), /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
1271
|
+
checked: generateTxt,
|
|
1272
|
+
onChange: () => setGenerateTxt(!generateTxt),
|
|
1273
|
+
sx: {
|
|
1274
|
+
marginBottom: 2
|
|
1275
|
+
}
|
|
1276
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
1277
|
+
sx: {
|
|
1278
|
+
marginBottom: 2.5
|
|
1279
|
+
},
|
|
1280
|
+
fontWeight: "bold"
|
|
1281
|
+
}, t("generate_transcript")))), /*#__PURE__*/_react.default.createElement(AddPhraseDialog, {
|
|
1262
1282
|
t: t,
|
|
1263
1283
|
open: dialogOpen,
|
|
1264
1284
|
onClose: () => setDialogOpen(false),
|
|
@@ -1328,13 +1348,25 @@ function GenerateAudio({
|
|
|
1328
1348
|
variant: "contained",
|
|
1329
1349
|
onClick: () => downloadAudio({
|
|
1330
1350
|
language: learnLang,
|
|
1331
|
-
voiceName: formik.values.actor.voice
|
|
1351
|
+
voiceName: formik.values.actor.voice,
|
|
1352
|
+
text: formik.values.phraseToSpeak
|
|
1332
1353
|
}),
|
|
1333
1354
|
sx: {
|
|
1334
1355
|
width: "150px",
|
|
1335
1356
|
marginBottom: 2
|
|
1336
1357
|
},
|
|
1337
1358
|
disabled: !audioUrl || formik.values.phraseToSpeak === "" || checkAudioUrl
|
|
1338
|
-
}, t("download"))
|
|
1359
|
+
}, t("download")), /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
1360
|
+
checked: generateTxt,
|
|
1361
|
+
onChange: () => setGenerateTxt(!generateTxt),
|
|
1362
|
+
sx: {
|
|
1363
|
+
marginBottom: 2
|
|
1364
|
+
}
|
|
1365
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
1366
|
+
sx: {
|
|
1367
|
+
marginBottom: 2.5
|
|
1368
|
+
},
|
|
1369
|
+
fontWeight: "bold"
|
|
1370
|
+
}, t("generate_transcript")))))));
|
|
1339
1371
|
}
|
|
1340
1372
|
var _default = exports.default = GenerateAudio;
|