@nualang/nualang-ui-components 0.1.1281 → 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.
@@ -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.jsx)(_InputHelper.Adornment, {
150
- t: t,
151
- emoji: true,
152
- name: inputName,
153
- value: inputValue,
154
- onChange: handleInputChange,
155
- adornmentPosition: "end",
156
- iconButtonEdge: false,
157
- characters: characters,
158
- activeRef: activeRef,
159
- whiteIcon: true,
160
- whiteCharacters: (disableInput || isListening) && theme.palette.mode === "dark" ? true : false
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)(_jsxRuntime.Fragment, {
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.heritageSpeakers && featureFlags.advancedStudents && member.isHeritageSpeaker && member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
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.heritageSpeakers && member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
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.advancedStudents && member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
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.heritageSpeakers && (member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
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.advancedStudents && (member.assignedLabels?.isAdvancedStudent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
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: {
@@ -504,6 +504,9 @@ function Classroom({
504
504
  isLoadingAssignments,
505
505
  ...otherProps
506
506
  }) {
507
+ // ensure these exist before any use (avoids TDZ / ReferenceError)
508
+ let tabs = [];
509
+ let classroomCreatorWelcome = "classroom_creator_welcome";
507
510
  const {
508
511
  handleJoinMeeting,
509
512
  discussions,
@@ -555,16 +558,86 @@ function Classroom({
555
558
  const [scrollToDiscuss, setScrollToDiscuss] = (0, _react.useState)(false);
556
559
  const [scrollToDynamicResponses, setScrollToDynamicResponses] = (0, _react.useState)(false);
557
560
  const [displayDynamicAiDialog, setDisplayDynamicAiDialog] = (0, _react.useState)(false);
561
+ const [scheduledDynamicAi, setScheduledDynamicAi] = (0, _react.useState)(false);
558
562
  const isWaysideClassroom = classroom?.classroomId?.toLowerCase().includes("wayside");
559
563
  const [isSubscriptionExpired, setIsSubscriptionExpired] = (0, _react.useState)(false);
560
- let tabs;
564
+ const joyrideSteps = [{
565
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
566
+ children: t(`${classroomCreatorWelcome}`)
567
+ }),
568
+ placement: "center",
569
+ target: "body"
570
+ }, {
571
+ content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
572
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
573
+ children: t("classroom_creator_add_courses")
574
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
575
+ children: t("classroom_creator_add_courses_desc")
576
+ })]
577
+ }),
578
+ spotlightPadding: 8,
579
+ target: "#add-courses-fab"
580
+ }, {
581
+ content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
582
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
583
+ children: t("classroom_creator_add_students_email")
584
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
585
+ children: t("classroom_creator_add_students_email_desc")
586
+ })]
587
+ }),
588
+ spotlightPadding: 8,
589
+ target: "#invite"
590
+ }, {
591
+ content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
592
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
593
+ children: t("classroom_creator_play_live_game")
594
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
595
+ children: t("classroom_creator_play_live_game_desc")
596
+ })]
597
+ }),
598
+ spotlightPadding: 8,
599
+ target: "#play-live"
600
+ }, {
601
+ content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
602
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
603
+ children: t("classroom_creator_track_progress")
604
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
605
+ children: t("classroom_creator_track_progress_desc")
606
+ })]
607
+ }),
608
+ spotlightPadding: 8,
609
+ target: "#Progress"
610
+ }];
611
+ const [joyrideState, setJoyrideState] = (0, _react.useState)({
612
+ run: false,
613
+ steps: joyrideSteps
614
+ });
615
+ const {
616
+ run,
617
+ steps
618
+ } = joyrideState;
561
619
  (0, _react.useEffect)(() => {
562
620
  const hasDisplayed = localStorage.getItem("displayDynamicAiDialog");
563
621
  if (!hasDisplayed && classroom?.isCreator) {
622
+ setScheduledDynamicAi(true);
623
+ }
624
+ }, [classroom]);
625
+ (0, _react.useEffect)(() => {
626
+ if (scheduledDynamicAi && !run && !isPictureDialogOpen) {
564
627
  setDisplayDynamicAiDialog(true);
628
+ setScheduledDynamicAi(false);
565
629
  localStorage.setItem("displayDynamicAiDialog", "true");
566
630
  }
567
- }, [classroom]);
631
+ }, [scheduledDynamicAi, run, isPictureDialogOpen]);
632
+ const handleUpdateAvatarAndLearnLang = () => {
633
+ if (!attributes || !attributes.picture) {
634
+ setIsPictureDialogOpen(true);
635
+ }
636
+ if ((!attributes || !attributes[`custom:learnLang`]) && classroom && classroom.learnLang) {
637
+ handleUpdateUserLearnLang(classroom.learnLang);
638
+ }
639
+ localStorage.setItem(`classroom-update-avatar-prompt-${username}`, "true");
640
+ };
568
641
  (0, _react.useEffect)(() => {
569
642
  if (creatorSubscription?.isPaidUser === false) {
570
643
  setIsSubscriptionExpired(true);
@@ -625,79 +698,12 @@ function Classroom({
625
698
  };
626
699
  const condition = !loading && !isCoursesLoading && assignments?.length > 0;
627
700
  useSetLastFetched(condition, assignments, setHasNewAssignments);
628
- let classroomCreatorWelcome = "classroom_creator_welcome";
629
- if (freeTrial) {
630
- classroomCreatorWelcome = "classroom_creator_welcome_free_trial";
631
- }
632
- const joyrideSteps = [{
633
- content: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
634
- children: t(`${classroomCreatorWelcome}`)
635
- }),
636
- placement: "center",
637
- target: "body"
638
- }, {
639
- content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
640
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
641
- children: t("classroom_creator_add_courses")
642
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
643
- children: t("classroom_creator_add_courses_desc")
644
- })]
645
- }),
646
- spotlightPadding: 8,
647
- target: "#add-courses-fab"
648
- }, {
649
- content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
650
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
651
- children: t("classroom_creator_add_students_email")
652
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
653
- children: t("classroom_creator_add_students_email_desc")
654
- })]
655
- }),
656
- spotlightPadding: 8,
657
- target: "#invite"
658
- }, {
659
- content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
660
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
661
- children: t("classroom_creator_play_live_game")
662
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
663
- children: t("classroom_creator_play_live_game_desc")
664
- })]
665
- }),
666
- spotlightPadding: 8,
667
- target: "#play-live"
668
- }, {
669
- content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
670
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
671
- children: t("classroom_creator_track_progress")
672
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
673
- children: t("classroom_creator_track_progress_desc")
674
- })]
675
- }),
676
- spotlightPadding: 8,
677
- target: "#Progress"
678
- }];
679
- const [joyrideState, setJoyrideState] = (0, _react.useState)({
680
- run: false,
681
- steps: joyrideSteps
682
- });
683
- const {
684
- run,
685
- steps
686
- } = joyrideState;
687
- const handleUpdateAvatarAndLearnLang = () => {
688
- if (!attributes || !attributes.picture) {
689
- setIsPictureDialogOpen(true);
690
- }
691
- if ((!attributes || !attributes[`custom:learnLang`]) && classroom && classroom.learnLang) {
692
- handleUpdateUserLearnLang(classroom.learnLang);
693
- }
694
- localStorage.setItem(`classroom-update-avatar-prompt-${username}`, "true");
695
- };
701
+ classroomCreatorWelcome = freeTrial ? "classroom_creator_welcome_free_trial" : classroomCreatorWelcome;
696
702
  (0, _react.useEffect)(() => {
697
703
  const isClassroomCreator = classroom && classroom.isCreator;
698
704
  const tourCompleted = localStorage.getItem(`classroom-creator-tour-completed`);
699
705
  const shouldPromptAvatarUpdate = !localStorage.getItem(`classroom-update-avatar-prompt-${username}`);
700
- if (isClassroomCreator && !tourCompleted) {
706
+ if (isClassroomCreator && !tourCompleted && !run) {
701
707
  setJoyrideState(prevState => ({
702
708
  ...prevState,
703
709
  run: true
@@ -707,7 +713,7 @@ function Classroom({
707
713
  if (shouldPromptAvatarUpdate && (isClassroomCreator && tourCompleted || isMember)) {
708
714
  handleUpdateAvatarAndLearnLang();
709
715
  }
710
- }, [classroom, isMember, username]);
716
+ }, [classroom, isMember, username, run]);
711
717
  const handleJoyrideCallback = data => {
712
718
  const {
713
719
  status,
@@ -320,13 +320,13 @@ function Progress({
320
320
  return members.filter(member => {
321
321
  if (memberId) {
322
322
  return member.memberId === memberId;
323
- } else if (selectedMembers && selectedMembers.length && reportType === "assignments" && assignedStudents) {
323
+ } else if (selectedMembers && selectedMembers.length && reportType === "assignments" && selectedAssignment && assignedStudents) {
324
324
  const selectedMemberIds = selectedMembers.map(m => m.memberId);
325
325
  return selectedMemberIds.includes(member.memberId) && (assignedStudents || []).includes(member.memberId);
326
326
  } else if (selectedMembers && selectedMembers.length) {
327
327
  const selectedMemberIds = selectedMembers.map(m => m.memberId);
328
328
  return selectedMemberIds.includes(member.memberId);
329
- } else if (reportType === "assignments" && assignedStudents) {
329
+ } else if (reportType === "assignments" && selectedAssignment && assignedStudents) {
330
330
  return (assignedStudents || []).includes(member.memberId);
331
331
  }
332
332
  return true;
@@ -720,7 +720,7 @@ function TableRow({
720
720
  sx: {
721
721
  fontWeight: "bold"
722
722
  },
723
- children: featureFlags.heritageSpeakers && member.isHeritageSpeaker ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1281",
3
+ "version": "0.1.1283",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",