@nualang/nualang-ui-components 0.1.1316 → 0.1.1318

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.
@@ -123,7 +123,12 @@ function Bot({
123
123
  sm: "85%"
124
124
  },
125
125
  children: [/*#__PURE__*/_jsx(Avatar, {
126
- src: bot.picture
126
+ src: bot.picture || bot.botAvatar,
127
+ sx: {
128
+ display: "flex",
129
+ width: 32,
130
+ height: 32
131
+ }
127
132
  }), /*#__PURE__*/_jsx(ListItemText, {
128
133
  sx: {
129
134
  marginLeft: 2
@@ -206,7 +206,7 @@ function Roleplay({
206
206
  sm: "85%"
207
207
  },
208
208
  children: [/*#__PURE__*/_jsx(Avatar, {
209
- src: roleplay.picture,
209
+ src: roleplay.picture || roleplay.actor1 && roleplay.actor1.picture || roleplay.actor2 && roleplay.actor2.picture,
210
210
  sx: {
211
211
  display: "flex",
212
212
  width: 32,
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from "react";
2
- import { Dialog, DialogContent, IconButton, Box, Typography, AppBar, Toolbar, CircularProgress } from "@mui/material";
2
+ import { Dialog, DialogContent, IconButton, Box, Typography, AppBar, Toolbar, CircularProgress, Skeleton } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import { red, orange, green, grey } from "@mui/material/colors";
5
5
  import FeedbackCard from "../../Cards/FeedbackCard/FeedbackCard";
@@ -162,23 +162,50 @@ export default function GroupFeedbackDialog({
162
162
  },
163
163
  children: [/*#__PURE__*/_jsx(Box, {
164
164
  sx: {
165
- display: "flex",
166
- flexDirection: "column",
167
- alignItems: "center",
168
- justifyContent: "center",
169
- maxWidth: "25%"
165
+ position: "relative",
166
+ width: "100%",
167
+ maxWidth: "300px"
170
168
  },
171
- children: /*#__PURE__*/_jsx("img", {
172
- src: editMeetingImages || editBackgroundImages || NualaHeadphonesBackground,
173
- alt: "Meeting Image",
174
- style: {
169
+ children: /*#__PURE__*/_jsxs(Box, {
170
+ sx: {
171
+ position: "relative",
175
172
  width: "100%",
176
- maxWidth: "300px",
177
- height: "auto",
178
- aspectRatio: "16 / 9",
179
- objectFit: "cover",
180
- borderRadius: "8px"
181
- }
173
+ paddingTop: "56.25%",
174
+ borderRadius: "8px",
175
+ overflow: "hidden"
176
+ },
177
+ children: [/*#__PURE__*/_jsx(Skeleton, {
178
+ variant: "rectangular",
179
+ sx: {
180
+ position: "absolute",
181
+ top: 0,
182
+ left: 0,
183
+ width: "100%",
184
+ height: "100%",
185
+ borderRadius: "8px",
186
+ zIndex: 0
187
+ }
188
+ }), /*#__PURE__*/_jsx("img", {
189
+ src: editMeetingImages || editBackgroundImages || NualaHeadphonesBackground,
190
+ alt: "Meeting Image",
191
+ onLoad: e => {
192
+ setTimeout(() => {
193
+ e.target.style.opacity = 1;
194
+ }, 500);
195
+ },
196
+ style: {
197
+ position: "absolute",
198
+ top: 0,
199
+ left: 0,
200
+ width: "100%",
201
+ height: "100%",
202
+ objectFit: "cover",
203
+ borderRadius: "8px",
204
+ opacity: 0,
205
+ transition: "opacity 0.5s ease",
206
+ zIndex: 1
207
+ }
208
+ })]
182
209
  })
183
210
  }), /*#__PURE__*/_jsxs(Box, {
184
211
  sx: {
@@ -80,6 +80,7 @@ const WordText = /*#__PURE__*/memo(props => {
80
80
  leaveDelay: 200,
81
81
  title: translatedText,
82
82
  children: /*#__PURE__*/_jsx("span", {
83
+ translate: "no",
83
84
  "data-text": value.trim(),
84
85
  children: value
85
86
  })
@@ -111,7 +111,8 @@ const useStyles = makeStyles()(theme => ({
111
111
  position: "relative",
112
112
  "@media print": {
113
113
  display: "none"
114
- }
114
+ },
115
+ paddingBottom: "60px"
115
116
  },
116
117
  moreOptions: {
117
118
  "@media print": {
@@ -1204,7 +1205,6 @@ function Classroom({
1204
1205
  onClick: () => {
1205
1206
  setIsCreateMeetingDialogOpen(true);
1206
1207
  },
1207
- title: t("schedule_discussion"),
1208
1208
  tabIndex: tabs.findIndex(tab => tab.id === "Discuss"),
1209
1209
  variant: "extended",
1210
1210
  disabled: !members || members.length === 0
@@ -1223,7 +1223,6 @@ function Classroom({
1223
1223
  onClick: () => {
1224
1224
  handleCreateAssignment();
1225
1225
  },
1226
- title: t("create_assignment"),
1227
1226
  tabIndex: tabs.findIndex(tab => tab.id === "Assignments"),
1228
1227
  variant: "extended",
1229
1228
  disabled: !members || members.length === 0 || !courses || courses.length === 0
@@ -1231,12 +1230,16 @@ function Classroom({
1231
1230
  const fabs = [[{
1232
1231
  color: "primary",
1233
1232
  className: null,
1234
- icon: /*#__PURE__*/_jsx(Add, {}),
1233
+ icon: /*#__PURE__*/_jsx(Add, {
1234
+ sx: {
1235
+ mr: 1
1236
+ }
1237
+ }),
1235
1238
  id: "add-courses-fab",
1239
+ buttonText: t("add_courses"),
1236
1240
  onClick: handleOpenCoursesModal,
1237
- title: t("add_courses"),
1238
1241
  tabIndex: tabs.findIndex(tab => tab.id === "Courses"),
1239
- variant: "circular"
1242
+ variant: "extended"
1240
1243
  }, vchatFab, assignmentsFab]];
1241
1244
  const initialTabValue = useMemo(() => {
1242
1245
  if (window.location.hash) {
@@ -1,6 +1,7 @@
1
1
  import { useState, useEffect, Fragment } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { withStyles } from "tss-react/mui";
4
+ import { useNavigate, useLocation } from "react-router-dom";
4
5
  import { Typography, Box, List, Dialog, DialogContent, Card, CardActionArea, Button, Select, FormControl, InputLabel, IconButton, Tooltip, CircularProgress, Divider, MenuItem } from "@mui/material";
5
6
  import { red, orange, green, grey } from "@mui/material/colors";
6
7
  import Styles from "../../utils/Styles";
@@ -11,6 +12,7 @@ import EditIcon from "@mui/icons-material/Edit";
11
12
  import ArchiveIcon from "@mui/icons-material/Archive";
12
13
  import dayjs from "dayjs";
13
14
  import GroupFeedbackDialog from "../../Dialogs/GroupedFeedbackDialog/GroupedFeedbackDialog";
15
+ import { useUrlQueryParam } from "../../hooks/useUrlQueryParam";
14
16
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
15
17
  const MeetingPromptsList = withStyles(({
16
18
  scheduleListData,
@@ -39,6 +41,8 @@ const MeetingPromptsList = withStyles(({
39
41
  getRecordings,
40
42
  startTimes = {}
41
43
  }) => {
44
+ const navigate = useNavigate();
45
+ const location = useLocation();
42
46
  const [selectedGroup, setSelectedGroup] = useState({});
43
47
  const [isDialogOpen, setDialogOpen] = useState(false);
44
48
  const [meetingCounts, setMeetingCounts] = useState({});
@@ -51,6 +55,20 @@ const MeetingPromptsList = withStyles(({
51
55
  const [isRecordingDialogOpen, setIsRecordingDialogOpen] = useState(false);
52
56
  const [attendeesData, setAttendeesData] = useState([]);
53
57
  const [loading, setLoading] = useState(false);
58
+ const [groupedIdFromUrl, setGroupedIdFromUrl, clearGroupedId] = useUrlQueryParam("groupedId", {
59
+ hash: "Discuss"
60
+ });
61
+ useEffect(() => {
62
+ if (groupedIdFromUrl && scheduleListData.length > 0) {
63
+ const discussion = scheduleListData.find(item => item.groupedId === groupedIdFromUrl);
64
+ if (discussion) {
65
+ setSelectedGroup(discussion);
66
+ setSelectedDiscussion(discussion);
67
+ setGroupedId(discussion.groupedId);
68
+ setDialogOpen(true);
69
+ }
70
+ }
71
+ }, [groupedIdFromUrl, scheduleListData, setSelectedDiscussion]);
54
72
  const calculateMeetingCounts = () => {
55
73
  const counts = {};
56
74
  scheduleListData?.forEach(item => {
@@ -113,6 +131,8 @@ const MeetingPromptsList = withStyles(({
113
131
  };
114
132
  const closeDialog = () => {
115
133
  setDialogOpen(false);
134
+ setSelectedGroup({});
135
+ clearGroupedId();
116
136
  };
117
137
  useEffect(() => {
118
138
  const selectedDiscussionGroup = scheduleListData.filter(item => item.groupedId === groupedId);
@@ -201,6 +221,7 @@ const MeetingPromptsList = withStyles(({
201
221
  setSelectedDiscussion(discussion);
202
222
  setGroupedId(discussion?.groupedId);
203
223
  openDialog();
224
+ setGroupedIdFromUrl(discussion.groupedId);
204
225
  },
205
226
  children: /*#__PURE__*/_jsxs(Box, {
206
227
  sx: {
@@ -361,8 +382,7 @@ const MeetingPromptsList = withStyles(({
361
382
  }), sortedScheduleListData?.length > cardsToShow && /*#__PURE__*/_jsx(Button, {
362
383
  variant: "outlined",
363
384
  "aria-label": t("view_more"),
364
- onClick: () => setCardsToShow(cardsToShow + 2) // Load 2 more cards on button click
365
- ,
385
+ onClick: () => setCardsToShow(cardsToShow + 2),
366
386
  children: t("view_more")
367
387
  })]
368
388
  }), /*#__PURE__*/_jsx(ConfirmDeleteDiscussion, {
@@ -1,4 +1,4 @@
1
- import { useState, Fragment } from "react";
1
+ import { useState, useEffect, Fragment } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { withStyles } from "tss-react/mui";
4
4
  import { Typography, Box, Button } from "@mui/material";
@@ -7,6 +7,7 @@ import RecordingDialog from "../../Dialogs/RecordingDialog/RecordingDialog";
7
7
  import FeedbackDialog from "../../Dialogs/FeedbackInfoDialog/FeedbackInfoDialog";
8
8
  import RecordingCard from "../../Cards/RecordingCard/RecordingCard";
9
9
  import LoadingCard from "../../Cards/LoadingCard/LoadingCard";
10
+ import { useUrlQueryParam } from "../../hooks/useUrlQueryParam";
10
11
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const RecordingListCards = withStyles(({
12
13
  classes,
@@ -31,6 +32,18 @@ const RecordingListCards = withStyles(({
31
32
  const [open, setOpen] = useState(false);
32
33
  const [feedbackOpen, setFeedbackOpen] = useState(false);
33
34
  const [cardsToShow, setCardsToShow] = useState(3);
35
+ const [recordingIdFromUrl, setRecordingIdFromUrl, clearRecordingIdFromUrl] = useUrlQueryParam("meetingId", {
36
+ hash: 'Discuss'
37
+ });
38
+ useEffect(() => {
39
+ if (recordingIdFromUrl && recordingsTableData.length > 0) {
40
+ const recording = recordingsTableData.find(rec => (rec.meetingId || rec.meetingID)?.toString() === recordingIdFromUrl.toString());
41
+ if (recording) {
42
+ setSelectedRecording(recording);
43
+ setOpen(true);
44
+ }
45
+ }
46
+ }, [recordingIdFromUrl, recordingsTableData, setSelectedRecording]);
34
47
  const attendeeUsernames = [];
35
48
  userData.forEach(user => {
36
49
  [selectedRecording?.attendees].flat().forEach(attendee => {
@@ -50,6 +63,7 @@ const RecordingListCards = withStyles(({
50
63
  const handleJoin = recording => {
51
64
  setSelectedRecording(recording);
52
65
  setOpen(true);
66
+ setRecordingIdFromUrl(recording.meetingId);
53
67
  };
54
68
  const handleFeedbackJoin = recording => {
55
69
  setSelectedRecording(recording);
@@ -58,6 +72,7 @@ const RecordingListCards = withStyles(({
58
72
  const handleClose = () => {
59
73
  resetVideoState();
60
74
  setOpen(false);
75
+ clearRecordingIdFromUrl();
61
76
  };
62
77
  return /*#__PURE__*/_jsxs(Fragment, {
63
78
  children: [/*#__PURE__*/_jsx(Box, {
@@ -122,25 +137,21 @@ const RecordingListCards = withStyles(({
122
137
  })), recordingsTableData?.length > cardsToShow && /*#__PURE__*/_jsx(Button, {
123
138
  variant: "outlined",
124
139
  "aria-label": t("view_more"),
125
- onClick: () => setCardsToShow(cardsToShow + 2) // Load 2 more cards on button click
126
- ,
140
+ onClick: () => setCardsToShow(cardsToShow + 2),
127
141
  children: t("view_more")
128
142
  })]
129
- }) : /*#__PURE__*/_jsx(_Fragment, {
130
- children: /*#__PURE__*/_jsx(Box, {
131
- sx: {
132
- display: "flex",
133
- alignItems: "center",
134
- justifyContent: "center",
135
- height: "15vh",
136
- // You can adjust the height as needed
137
- textAlign: "center" // Center-align text
138
- },
139
- children: /*#__PURE__*/_jsx(Typography, {
140
- component: "h5",
141
- variant: "h5",
142
- children: t("no_recordings_found")
143
- })
143
+ }) : /*#__PURE__*/_jsx(Box, {
144
+ sx: {
145
+ display: "flex",
146
+ alignItems: "center",
147
+ justifyContent: "center",
148
+ height: "15vh",
149
+ textAlign: "center"
150
+ },
151
+ children: /*#__PURE__*/_jsx(Typography, {
152
+ component: "h5",
153
+ variant: "h5",
154
+ children: t("no_recordings_found")
144
155
  })
145
156
  })]
146
157
  });
@@ -0,0 +1,27 @@
1
+ import { useCallback } from "react";
2
+ import { useLocation, useNavigate } from "react-router-dom";
3
+ export function useUrlQueryParam(name, {
4
+ hash
5
+ }) {
6
+ const location = useLocation();
7
+ const navigate = useNavigate();
8
+ const params = new URLSearchParams(location.search);
9
+ const value = params.get(name);
10
+ const setValue = useCallback(newValue => {
11
+ const newParams = new URLSearchParams(location.search);
12
+ if (newValue === null || newValue === undefined) {
13
+ newParams.delete(name);
14
+ } else {
15
+ newParams.set(name, newValue);
16
+ }
17
+ const queryString = newParams.toString();
18
+ const hashSuffix = hash ? `#${hash}` : location.hash;
19
+ navigate(`${location.pathname}${queryString ? `?${queryString}` : ""}${hashSuffix || ""}`, {
20
+ replace: true
21
+ });
22
+ }, [hash, location.pathname, location.search, location.hash, name, navigate]);
23
+ const clear = useCallback(() => {
24
+ setValue(null);
25
+ }, [setValue]);
26
+ return [value, setValue, clear];
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1316",
3
+ "version": "0.1.1318",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [