@nualang/nualang-ui-components 0.1.1282 → 0.1.1283
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/Chat/BottomBar/BottomBar.js +34 -18
- package/dist/Chat/Chat.js +14 -3
- package/dist/Dialogs/SelectClassroom/SelectClassroom.js +3 -0
- package/dist/Exercises/Bot/Bot.js +2 -1
- package/dist/Lists/Exercises/Exercises.js +81 -1
- package/dist/Lists/Members/Members.js +5 -5
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +0 -3
- package/dist/Tables/Progress/ProgressTable.js +1 -1
- package/dist/hooks/useExerciseState.js +4 -0
- package/package.json +1 -1
|
@@ -38,7 +38,11 @@ const useStyles = (0, _mui.makeStyles)()((theme, {
|
|
|
38
38
|
color: isPrimaryColor ? theme.palette.primary.contrastText : null
|
|
39
39
|
},
|
|
40
40
|
root: {
|
|
41
|
-
flexShrink: 0
|
|
41
|
+
flexShrink: 0,
|
|
42
|
+
alignItems: "flex-start",
|
|
43
|
+
minHeight: "auto",
|
|
44
|
+
paddingTop: theme.spacing(1),
|
|
45
|
+
paddingBottom: theme.spacing(1)
|
|
42
46
|
},
|
|
43
47
|
micButton: {
|
|
44
48
|
color: isListening ? theme.palette.error.main : "inherit"
|
|
@@ -95,7 +99,8 @@ function BottomBar({
|
|
|
95
99
|
handleOpenConfidence,
|
|
96
100
|
finalTranscript,
|
|
97
101
|
inputRef,
|
|
98
|
-
authenticated
|
|
102
|
+
authenticated,
|
|
103
|
+
isAdvancedBot = false
|
|
99
104
|
}) {
|
|
100
105
|
const {
|
|
101
106
|
classes
|
|
@@ -114,6 +119,7 @@ function BottomBar({
|
|
|
114
119
|
};
|
|
115
120
|
const textInput = (0, _react.useRef)(null);
|
|
116
121
|
const activeRef = inputRef ? inputRef : textInput;
|
|
122
|
+
const isSmallScreen = (0, _useMediaQuery.default)(theme.breakpoints.down("md"));
|
|
117
123
|
const TextInput = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
118
124
|
className: classes.input,
|
|
119
125
|
id: "keyboardInput",
|
|
@@ -127,7 +133,7 @@ function BottomBar({
|
|
|
127
133
|
onKeyPress: handleKeyPress,
|
|
128
134
|
placeholder: placeholder,
|
|
129
135
|
inputProps: {
|
|
130
|
-
maxLength: 200,
|
|
136
|
+
maxLength: isAdvancedBot ? 600 : 200,
|
|
131
137
|
sx: theme => ({
|
|
132
138
|
"&::placeholder": {
|
|
133
139
|
color: theme.palette.mode === "light" ? _colors.grey[200] : _colors.grey[800],
|
|
@@ -137,6 +143,7 @@ function BottomBar({
|
|
|
137
143
|
},
|
|
138
144
|
disableUnderline: true,
|
|
139
145
|
multiline: true,
|
|
146
|
+
rows: isAdvancedBot ? 3 : 1,
|
|
140
147
|
autoComplete: autoComplete,
|
|
141
148
|
inputRef: activeRef,
|
|
142
149
|
onClick: handleSelectCurrentInput,
|
|
@@ -146,18 +153,30 @@ function BottomBar({
|
|
|
146
153
|
fontWeight: 800
|
|
147
154
|
}
|
|
148
155
|
}),
|
|
149
|
-
endAdornment: /*#__PURE__*/(0, _jsxRuntime.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
157
|
+
children: [!isSmallScreen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
158
|
+
variant: "caption",
|
|
159
|
+
sx: {
|
|
160
|
+
color: "inherit",
|
|
161
|
+
opacity: inputValue.length >= (isAdvancedBot ? 600 : 200) ? 1 : 0.7,
|
|
162
|
+
marginRight: 1,
|
|
163
|
+
fontWeight: 700,
|
|
164
|
+
fontSize: "0.75rem"
|
|
165
|
+
},
|
|
166
|
+
children: `${inputValue.length}/${isAdvancedBot ? 600 : 200}`
|
|
167
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputHelper.Adornment, {
|
|
168
|
+
t: t,
|
|
169
|
+
emoji: true,
|
|
170
|
+
name: inputName,
|
|
171
|
+
value: inputValue,
|
|
172
|
+
onChange: handleInputChange,
|
|
173
|
+
adornmentPosition: "end",
|
|
174
|
+
iconButtonEdge: false,
|
|
175
|
+
characters: characters,
|
|
176
|
+
activeRef: activeRef,
|
|
177
|
+
whiteIcon: true,
|
|
178
|
+
whiteCharacters: (disableInput || isListening) && theme.palette.mode === "dark" ? true : false
|
|
179
|
+
})]
|
|
161
180
|
}),
|
|
162
181
|
classes: {
|
|
163
182
|
root: classes.inputRoot,
|
|
@@ -165,7 +184,6 @@ function BottomBar({
|
|
|
165
184
|
}
|
|
166
185
|
})
|
|
167
186
|
});
|
|
168
|
-
const isSmallScreen = (0, _useMediaQuery.default)(theme.breakpoints.down("md"));
|
|
169
187
|
const buttonRef = (0, _react.useRef)(null);
|
|
170
188
|
(0, _react.useEffect)(() => {
|
|
171
189
|
const handleEnterKey = event => {
|
|
@@ -186,8 +204,6 @@ function BottomBar({
|
|
|
186
204
|
(0, _react.useEffect)(() => {
|
|
187
205
|
if (activeRef.current) {
|
|
188
206
|
activeRef.current.focus();
|
|
189
|
-
const length = inputValue.length;
|
|
190
|
-
activeRef.current.setSelectionRange(length, length);
|
|
191
207
|
}
|
|
192
208
|
}, [inputValue]);
|
|
193
209
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, {
|
package/dist/Chat/Chat.js
CHANGED
|
@@ -99,11 +99,21 @@ function Chat({
|
|
|
99
99
|
answerCounts,
|
|
100
100
|
noAnswerCounts,
|
|
101
101
|
isDynamicResponsesEnabled,
|
|
102
|
-
isUserInternal
|
|
102
|
+
isUserInternal,
|
|
103
|
+
isAdvancedBot = false
|
|
103
104
|
}) {
|
|
104
105
|
const {
|
|
105
106
|
classes
|
|
106
107
|
} = useStyles();
|
|
108
|
+
const [isMessageLoading, setIsMessageLoading] = (0, _react.useState)(false);
|
|
109
|
+
(0, _react.useEffect)(() => {
|
|
110
|
+
if (!Array.isArray(messages) || messages.length === 0) {
|
|
111
|
+
setIsMessageLoading(false);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const hasLoadingMessage = messages.some(message => typeof message === 'object' && message?.isLoading === true);
|
|
115
|
+
setIsMessageLoading(hasLoadingMessage);
|
|
116
|
+
}, [messages]);
|
|
107
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
108
118
|
className: classes.root,
|
|
109
119
|
children: [!viewAttemptMode && !isLiveGame && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TopBar.default, {
|
|
@@ -169,7 +179,7 @@ function Chat({
|
|
|
169
179
|
t: t,
|
|
170
180
|
inputName: inputName,
|
|
171
181
|
inputValue: inputValue,
|
|
172
|
-
disableInput: disableInput,
|
|
182
|
+
disableInput: disableInput || isMessageLoading,
|
|
173
183
|
focusInput: focusInput,
|
|
174
184
|
handleInputChange: handleInputChange,
|
|
175
185
|
isListening: isListening,
|
|
@@ -191,7 +201,8 @@ function Chat({
|
|
|
191
201
|
finalTranscript: finalTranscript,
|
|
192
202
|
inputRef: inputRef,
|
|
193
203
|
authenticated: authenticated,
|
|
194
|
-
placeholder: placeholder
|
|
204
|
+
placeholder: placeholder,
|
|
205
|
+
isAdvancedBot: isAdvancedBot
|
|
195
206
|
})]
|
|
196
207
|
});
|
|
197
208
|
}
|
|
@@ -61,6 +61,9 @@ function SelectClassroom({
|
|
|
61
61
|
button: true,
|
|
62
62
|
component: _reactRouterDom.Link,
|
|
63
63
|
to: path,
|
|
64
|
+
sx: {
|
|
65
|
+
color: 'inherit'
|
|
66
|
+
},
|
|
64
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemAvatar.default, {
|
|
65
68
|
children: picture ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
66
69
|
src: picture,
|
|
@@ -647,7 +647,8 @@ function Bot({
|
|
|
647
647
|
isSpeaking: isSpeaking,
|
|
648
648
|
isSpeakingTextContainer: isSpeakingTextContainer,
|
|
649
649
|
isDynamicResponsesEnabled: isDynamicResponsesClassroomEnabled,
|
|
650
|
-
isUserInternal: isUserInternal
|
|
650
|
+
isUserInternal: isUserInternal,
|
|
651
|
+
isAdvancedBot: bot.isAdvancedBot
|
|
651
652
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveDialog.default, {
|
|
652
653
|
open: instructionDialogOpen,
|
|
653
654
|
handleClose: handleCloseInstructions,
|
|
@@ -27,6 +27,7 @@ var _immutabilityHelper = _interopRequireDefault(require("immutability-helper"))
|
|
|
27
27
|
var _utils = require("../../utils");
|
|
28
28
|
var _FlashOn = _interopRequireDefault(require("@mui/icons-material/FlashOn"));
|
|
29
29
|
var _FlashOff = _interopRequireDefault(require("@mui/icons-material/FlashOff"));
|
|
30
|
+
var _Tooltip = require("@mui/material/Tooltip");
|
|
30
31
|
var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
|
|
31
32
|
var _RecordVoiceOver = _interopRequireDefault(require("@mui/icons-material/RecordVoiceOver"));
|
|
32
33
|
var _SwapHoriz = _interopRequireDefault(require("@mui/icons-material/SwapHoriz"));
|
|
@@ -615,6 +616,53 @@ function BotListItem({
|
|
|
615
616
|
};
|
|
616
617
|
const botCompletions = numberOfBotCompletions(completions, bot.botId);
|
|
617
618
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
619
|
+
const AdvancedBotHtmlTooltip = (0, _system.styled)(({
|
|
620
|
+
className,
|
|
621
|
+
...props
|
|
622
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
623
|
+
...props,
|
|
624
|
+
classes: {
|
|
625
|
+
popper: className
|
|
626
|
+
},
|
|
627
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
628
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
629
|
+
style: {
|
|
630
|
+
fontWeight: "bold",
|
|
631
|
+
marginBottom: "8px"
|
|
632
|
+
},
|
|
633
|
+
children: t("challenge_mode")
|
|
634
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
635
|
+
style: {
|
|
636
|
+
marginBottom: "8px"
|
|
637
|
+
},
|
|
638
|
+
children: t("advanced_bot_desc")
|
|
639
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
640
|
+
style: {
|
|
641
|
+
fontSize: "12px"
|
|
642
|
+
},
|
|
643
|
+
children: t("freely_changed")
|
|
644
|
+
})]
|
|
645
|
+
})
|
|
646
|
+
}))(({
|
|
647
|
+
theme
|
|
648
|
+
}) => ({
|
|
649
|
+
[`& .${_Tooltip.tooltipClasses.tooltip}`]: {
|
|
650
|
+
padding: theme.spacing(2),
|
|
651
|
+
backgroundColor: theme.palette.background.paper,
|
|
652
|
+
color: theme.palette.text.primary,
|
|
653
|
+
fontSize: theme.typography.pxToRem(12),
|
|
654
|
+
border: `1px solid ${theme.palette.divider}`
|
|
655
|
+
},
|
|
656
|
+
[`& ul`]: {
|
|
657
|
+
listStyleType: "disc",
|
|
658
|
+
paddingLeft: theme.spacing(2),
|
|
659
|
+
margin: 0
|
|
660
|
+
},
|
|
661
|
+
[`& li`]: {
|
|
662
|
+
display: "list-item",
|
|
663
|
+
marginBottom: theme.spacing(0.5)
|
|
664
|
+
}
|
|
665
|
+
}));
|
|
618
666
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
619
667
|
children: [(!isBotHiddenState || isCreator) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItem, {
|
|
620
668
|
ref: ref,
|
|
@@ -709,7 +757,31 @@ function BotListItem({
|
|
|
709
757
|
alt: ""
|
|
710
758
|
})
|
|
711
759
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
712
|
-
primary: isLargeScreen ? bot.botName || "" : /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
760
|
+
primary: isLargeScreen ? !isBotAdvanced ? bot.botName || "" : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
761
|
+
display: "flex",
|
|
762
|
+
alignItems: "center",
|
|
763
|
+
gap: "8px",
|
|
764
|
+
children: [bot.botName || "", /*#__PURE__*/(0, _jsxRuntime.jsx)(AdvancedBotHtmlTooltip, {
|
|
765
|
+
placement: "right",
|
|
766
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
767
|
+
label: t("challenge_mode"),
|
|
768
|
+
size: "small",
|
|
769
|
+
variant: "outlined",
|
|
770
|
+
color: "primary"
|
|
771
|
+
})
|
|
772
|
+
})]
|
|
773
|
+
}) : !isBotAdvanced ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
774
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
775
|
+
mb: 1,
|
|
776
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
777
|
+
src: bot.picture || bot.botAvatar || _index.default.bot,
|
|
778
|
+
alt: ""
|
|
779
|
+
})
|
|
780
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
781
|
+
variant: "body1",
|
|
782
|
+
children: bot.botName || ""
|
|
783
|
+
})]
|
|
784
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
713
785
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
714
786
|
mb: 1,
|
|
715
787
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
@@ -719,6 +791,14 @@ function BotListItem({
|
|
|
719
791
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
720
792
|
variant: "body1",
|
|
721
793
|
children: bot.botName || ""
|
|
794
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(AdvancedBotHtmlTooltip, {
|
|
795
|
+
placement: "right",
|
|
796
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
797
|
+
label: t("challenge_mode"),
|
|
798
|
+
size: "small",
|
|
799
|
+
variant: "outlined",
|
|
800
|
+
color: "primary"
|
|
801
|
+
})
|
|
722
802
|
})]
|
|
723
803
|
}),
|
|
724
804
|
secondary: isLargeScreen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
@@ -213,7 +213,7 @@ function Member(props) {
|
|
|
213
213
|
})
|
|
214
214
|
})
|
|
215
215
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
216
|
-
primary: featureFlags.
|
|
216
|
+
primary: featureFlags.classroomModes.readWrite && featureFlags.classroomModes.challenge && member.isHeritageSpeaker && member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
217
217
|
display: "flex",
|
|
218
218
|
alignItems: "center",
|
|
219
219
|
gap: "8px",
|
|
@@ -234,7 +234,7 @@ function Member(props) {
|
|
|
234
234
|
color: "primary"
|
|
235
235
|
})
|
|
236
236
|
})]
|
|
237
|
-
}) : featureFlags.
|
|
237
|
+
}) : featureFlags.classroomModes.readWrite && member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
238
238
|
display: "flex",
|
|
239
239
|
alignItems: "center",
|
|
240
240
|
gap: "8px",
|
|
@@ -247,7 +247,7 @@ function Member(props) {
|
|
|
247
247
|
color: "primary"
|
|
248
248
|
})
|
|
249
249
|
})]
|
|
250
|
-
}) : featureFlags.
|
|
250
|
+
}) : featureFlags.classroomModes.challenge && member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
251
251
|
display: "flex",
|
|
252
252
|
alignItems: "center",
|
|
253
253
|
gap: "8px",
|
|
@@ -276,7 +276,7 @@ function Member(props) {
|
|
|
276
276
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(OverflowMenu, {
|
|
277
277
|
anchorEl: anchorEl,
|
|
278
278
|
handleClose: handleCloseMenu,
|
|
279
|
-
children: [featureFlags.
|
|
279
|
+
children: [featureFlags.classroomModes.readWrite && (member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
280
280
|
onClick: () => {
|
|
281
281
|
handleUpdateClassroomMember(member.classroomId, member.memberId, {
|
|
282
282
|
isHeritageSpeaker: false
|
|
@@ -299,7 +299,7 @@ function Member(props) {
|
|
|
299
299
|
primary: t("mark_as_heritage_speaker")
|
|
300
300
|
})
|
|
301
301
|
})
|
|
302
|
-
})), featureFlags.
|
|
302
|
+
})), featureFlags.classroomModes.challenge && (member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
303
303
|
onClick: () => {
|
|
304
304
|
handleUpdateClassroomMember(member.classroomId, member.memberId, {
|
|
305
305
|
assignedLabels: {
|
|
@@ -561,8 +561,6 @@ function Classroom({
|
|
|
561
561
|
const [scheduledDynamicAi, setScheduledDynamicAi] = (0, _react.useState)(false);
|
|
562
562
|
const isWaysideClassroom = classroom?.classroomId?.toLowerCase().includes("wayside");
|
|
563
563
|
const [isSubscriptionExpired, setIsSubscriptionExpired] = (0, _react.useState)(false);
|
|
564
|
-
|
|
565
|
-
// Joyride steps & state must be declared before any useEffect that reads `run`
|
|
566
564
|
const joyrideSteps = [{
|
|
567
565
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
568
566
|
children: t(`${classroomCreatorWelcome}`)
|
|
@@ -628,7 +626,6 @@ function Classroom({
|
|
|
628
626
|
if (scheduledDynamicAi && !run && !isPictureDialogOpen) {
|
|
629
627
|
setDisplayDynamicAiDialog(true);
|
|
630
628
|
setScheduledDynamicAi(false);
|
|
631
|
-
// mark as displayed so it won't re-run on future page loads
|
|
632
629
|
localStorage.setItem("displayDynamicAiDialog", "true");
|
|
633
630
|
}
|
|
634
631
|
}, [scheduledDynamicAi, run, isPictureDialogOpen]);
|
|
@@ -720,7 +720,7 @@ function TableRow({
|
|
|
720
720
|
sx: {
|
|
721
721
|
fontWeight: "bold"
|
|
722
722
|
},
|
|
723
|
-
children: featureFlags.
|
|
723
|
+
children: featureFlags.classroomModes.readWrite && member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
724
724
|
display: "flex",
|
|
725
725
|
alignItems: "center",
|
|
726
726
|
gap: "8px",
|
|
@@ -922,6 +922,8 @@ function useExerciseState({
|
|
|
922
922
|
setBotVars(null);
|
|
923
923
|
setBotText("");
|
|
924
924
|
setBotMessages([]);
|
|
925
|
+
setConversationHistory([]);
|
|
926
|
+
setIsFirstMessage(true);
|
|
925
927
|
deleteProgress();
|
|
926
928
|
setChecked(false);
|
|
927
929
|
setActorHasBeenSelected(false);
|
|
@@ -945,6 +947,8 @@ function useExerciseState({
|
|
|
945
947
|
setBotVars(null);
|
|
946
948
|
setBotText("");
|
|
947
949
|
setBotMessages([]);
|
|
950
|
+
setConversationHistory([]);
|
|
951
|
+
setIsFirstMessage(true);
|
|
948
952
|
deleteProgress();
|
|
949
953
|
if (exerciseName === "roleplay" && !gameId.startsWith("act-it-out")) {
|
|
950
954
|
// if act-it-out need to select actor
|