@nualang/nualang-ui-components 0.1.1266 → 0.1.1268
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/Cards/Course/Course.js +1 -1
- package/dist/Chat/BottomBar/BottomBar.js +1 -0
- package/dist/Dialogs/GenerateBot/GenerateBot.js +5 -1
- package/dist/Dialogs/GeneratePhrases/GeneratePhrases.js +5 -1
- package/dist/Dialogs/GenerateRoleplay/GenerateRoleplay.js +5 -1
- package/dist/Lists/Phrases/Phrases.js +79 -2
- package/dist/Tables/TrialUsers/TrialUsers.js +2 -2
- package/package.json +2 -2
|
@@ -92,7 +92,7 @@ function OverflowMenu({
|
|
|
92
92
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
93
93
|
children: t("leave_course")
|
|
94
94
|
})]
|
|
95
|
-
}), classroomId && !isClassroomArchived && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
|
|
95
|
+
}), isCreator && classroomId && !isClassroomArchived && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
|
|
96
96
|
onClick: () => {
|
|
97
97
|
localStorage.setItem("focusCourseSettings", true);
|
|
98
98
|
window.location.hash = "Settings";
|
|
@@ -266,7 +266,8 @@ function GenerateBotDialog({
|
|
|
266
266
|
required: true,
|
|
267
267
|
onChange: handleChange,
|
|
268
268
|
multiline: true,
|
|
269
|
-
rows: 3
|
|
269
|
+
rows: 3,
|
|
270
|
+
maxLength: 200
|
|
270
271
|
})
|
|
271
272
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
272
273
|
size: 12,
|
|
@@ -286,6 +287,9 @@ function GenerateBotDialog({
|
|
|
286
287
|
marginBottom: 5
|
|
287
288
|
},
|
|
288
289
|
onChange: e => setTopicGoal(e.target.value),
|
|
290
|
+
inputProps: {
|
|
291
|
+
maxLength: 300
|
|
292
|
+
},
|
|
289
293
|
InputProps: {
|
|
290
294
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
291
295
|
position: "end",
|
|
@@ -244,7 +244,8 @@ function GeneratePhrases({
|
|
|
244
244
|
required: true,
|
|
245
245
|
onChange: handleChange,
|
|
246
246
|
multiline: true,
|
|
247
|
-
rows: 3
|
|
247
|
+
rows: 3,
|
|
248
|
+
maxLength: 300
|
|
248
249
|
})
|
|
249
250
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
250
251
|
mb: 2,
|
|
@@ -261,6 +262,9 @@ function GeneratePhrases({
|
|
|
261
262
|
variant: "outlined",
|
|
262
263
|
fullWidth: true,
|
|
263
264
|
onChange: handleChange,
|
|
265
|
+
inputProps: {
|
|
266
|
+
maxLength: 200
|
|
267
|
+
},
|
|
264
268
|
InputProps: {
|
|
265
269
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
266
270
|
position: "end",
|
|
@@ -394,7 +394,8 @@ function GenerateRoleplayDialog({
|
|
|
394
394
|
required: true,
|
|
395
395
|
onChange: handleChange,
|
|
396
396
|
multiline: true,
|
|
397
|
-
rows: 3
|
|
397
|
+
rows: 3,
|
|
398
|
+
maxLength: 300
|
|
398
399
|
})
|
|
399
400
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
400
401
|
size: 12,
|
|
@@ -413,6 +414,9 @@ function GenerateRoleplayDialog({
|
|
|
413
414
|
marginBottom: 5
|
|
414
415
|
},
|
|
415
416
|
onChange: e => setTopicGoal(e.target.value),
|
|
417
|
+
inputProps: {
|
|
418
|
+
maxLength: 300
|
|
419
|
+
},
|
|
416
420
|
InputProps: {
|
|
417
421
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
418
422
|
position: "end",
|
|
@@ -80,7 +80,8 @@ function Phrase(props) {
|
|
|
80
80
|
selectedPhrases,
|
|
81
81
|
handleSelectPhrase,
|
|
82
82
|
verificationStatus,
|
|
83
|
-
isDragDisabled
|
|
83
|
+
isDragDisabled,
|
|
84
|
+
setDisableDrag
|
|
84
85
|
} = props;
|
|
85
86
|
const {
|
|
86
87
|
phrase = "",
|
|
@@ -112,6 +113,7 @@ function Phrase(props) {
|
|
|
112
113
|
const handleClickOpenListener = () => {
|
|
113
114
|
if (isbrowserSupported) {
|
|
114
115
|
setIsListenerOpen(true);
|
|
116
|
+
setDisableDrag(true);
|
|
115
117
|
} else {
|
|
116
118
|
setbrowserSupported(false);
|
|
117
119
|
window.alert("Native microphone recording is only supported in https. Please use localhost for testing purposes");
|
|
@@ -123,12 +125,15 @@ function Phrase(props) {
|
|
|
123
125
|
};
|
|
124
126
|
const handleCloseListener = () => {
|
|
125
127
|
setIsListenerOpen(false);
|
|
128
|
+
setDisableDrag(false);
|
|
126
129
|
};
|
|
127
130
|
const handleClickOpenUpdate = () => {
|
|
128
131
|
setIsUpdateOpen(true);
|
|
132
|
+
setDisableDrag(true);
|
|
129
133
|
};
|
|
130
134
|
const handleCloseUpdate = () => {
|
|
131
135
|
setIsUpdateOpen(false);
|
|
136
|
+
setDisableDrag(false);
|
|
132
137
|
};
|
|
133
138
|
const combinedVoices = props.phrase.voices && props.phrase.voices.length > 0 ? [{
|
|
134
139
|
label: "Uploaded",
|
|
@@ -354,6 +359,7 @@ function PhraseList({
|
|
|
354
359
|
const [confirm] = (0, _useConfirm.default)(t);
|
|
355
360
|
const [phrasesArray, setPhrasesArray] = (0, _react.useState)([]);
|
|
356
361
|
const [selectedPhrases, setSelectedPhrases] = (0, _react.useState)([]);
|
|
362
|
+
const [disableDrag, setDisableDrag] = (0, _react.useState)(false);
|
|
357
363
|
|
|
358
364
|
// Used for useEffect as dependency to check for a phrase
|
|
359
365
|
// update in array.
|
|
@@ -435,7 +441,7 @@ function PhraseList({
|
|
|
435
441
|
}, index))
|
|
436
442
|
});
|
|
437
443
|
}
|
|
438
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_dragAndDrop.SortableDndContextWrapper, {
|
|
444
|
+
return !disableDrag ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dragAndDrop.SortableDndContextWrapper, {
|
|
439
445
|
onDragEnd: onDragEnd,
|
|
440
446
|
items: phrasesArray.map(phrase => `phrase-${phrase.phraseId}`),
|
|
441
447
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
@@ -504,10 +510,81 @@ function PhraseList({
|
|
|
504
510
|
handleRemovePhrase: handleRemovePhrase,
|
|
505
511
|
handleDeletePhrases: handleDeletePhrases,
|
|
506
512
|
isDragDisabled: isDragDisabled,
|
|
513
|
+
setDisableDrag: setDisableDrag,
|
|
507
514
|
...otherProps
|
|
508
515
|
})
|
|
509
516
|
}, `phrase-${phrase.phraseId}`))
|
|
510
517
|
})
|
|
518
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
519
|
+
className: classes.root,
|
|
520
|
+
disablePadding: disablePadding,
|
|
521
|
+
subheader: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
522
|
+
children: [isMember && !isCreator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListSubheader, {
|
|
523
|
+
disableSticky: true,
|
|
524
|
+
disableGutters: disableGutters,
|
|
525
|
+
component: "div",
|
|
526
|
+
id: "nested-list-subheader",
|
|
527
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
528
|
+
variant: "subtitle1",
|
|
529
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
530
|
+
display: "flex",
|
|
531
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
532
|
+
fontWeight: "fontWeightBold",
|
|
533
|
+
flexGrow: 1,
|
|
534
|
+
alignSelf: "center",
|
|
535
|
+
children: [t("phrases"), " (", phrases.length, ")"]
|
|
536
|
+
})
|
|
537
|
+
})
|
|
538
|
+
})
|
|
539
|
+
}), isCreator && phrasesArray.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListSubheader, {
|
|
540
|
+
disableSticky: true,
|
|
541
|
+
disableGutters: disableGutters,
|
|
542
|
+
component: "div",
|
|
543
|
+
id: "nested-list-subheader",
|
|
544
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
545
|
+
title: "Select all",
|
|
546
|
+
enterDelay: 200,
|
|
547
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Checkbox, {
|
|
548
|
+
indeterminate: selectedPhrases.length > 0 && selectedPhrases.length < phrasesArray.length,
|
|
549
|
+
checked: selectedPhrases.length === phrasesArray.length,
|
|
550
|
+
onChange: handleSelectAll,
|
|
551
|
+
inputProps: {
|
|
552
|
+
"aria-label": "Select all phrases"
|
|
553
|
+
},
|
|
554
|
+
TooltipTitle: "Select all phrases"
|
|
555
|
+
})
|
|
556
|
+
}), selectedPhrases.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
557
|
+
variant: "contained",
|
|
558
|
+
color: "primary",
|
|
559
|
+
onClick: () => handleDeletePhrases(),
|
|
560
|
+
startIcon: isLargeScreen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {}) : null,
|
|
561
|
+
style: {
|
|
562
|
+
marginLeft: "10px"
|
|
563
|
+
},
|
|
564
|
+
children: isLargeScreen ? t("Remove Phrases") : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {})
|
|
565
|
+
})]
|
|
566
|
+
})]
|
|
567
|
+
}),
|
|
568
|
+
children: phrasesArray.map((phrase, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_dragAndDrop.Sortable, {
|
|
569
|
+
disabled: isDragDisabled,
|
|
570
|
+
sortId: `phrase-${phrase.phraseId}`,
|
|
571
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Phrase, {
|
|
572
|
+
t: t,
|
|
573
|
+
phraseIndex: index,
|
|
574
|
+
phrase: phrase,
|
|
575
|
+
isCreator: isCreator,
|
|
576
|
+
disableGutters: disableGutters,
|
|
577
|
+
disableActions: disableActions,
|
|
578
|
+
disableDragAndDrop: disableDragAndDrop,
|
|
579
|
+
selectedPhrases: selectedPhrases,
|
|
580
|
+
handleSelectPhrase: handleSelectPhrase,
|
|
581
|
+
handleRemovePhrase: handleRemovePhrase,
|
|
582
|
+
handleDeletePhrases: handleDeletePhrases,
|
|
583
|
+
isDragDisabled: isDragDisabled,
|
|
584
|
+
setDisableDrag: setDisableDrag,
|
|
585
|
+
...otherProps
|
|
586
|
+
})
|
|
587
|
+
}, `phrase-${phrase.phraseId}`))
|
|
511
588
|
});
|
|
512
589
|
}
|
|
513
590
|
function Phrases(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nualang/nualang-ui-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1268",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@hookform/resolvers": "^3.6.0",
|
|
21
21
|
"@json2csv/plainjs": "^7.0.1",
|
|
22
22
|
"@nualang/avatars": "2.0.3",
|
|
23
|
-
"@nualang/nualang-api-and-queries": "^1.1.
|
|
23
|
+
"@nualang/nualang-api-and-queries": "^1.1.5",
|
|
24
24
|
"@storybook/theming": "^8.6.12",
|
|
25
25
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
26
26
|
"@stripe/stripe-js": "^1.54.2",
|