@nualang/nualang-ui-components 0.1.1221 → 0.1.1222
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/Category/Category.js +3 -3
- package/dist/Containers/App/App.js +10 -11
- package/dist/Forms/FeedbackForm/FeedbackForm.js +37 -0
- package/dist/Misc/AnswerResult/AnswerResult.js +3 -2
- package/dist/Navigation/ResponsiveDrawer/ResponsiveDrawer.js +62 -11
- package/dist/Navigation/_nav.js +3 -21
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ function Category({
|
|
|
23
23
|
const isSmallScreen = (0, _useMediaQuery.default)(theme.breakpoints.down("sm"));
|
|
24
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Card, {
|
|
25
25
|
sx: {
|
|
26
|
-
minHeight: isSmallScreen ?
|
|
26
|
+
minHeight: isSmallScreen ? 100 : 150,
|
|
27
27
|
background: backgroundColor,
|
|
28
28
|
color: "white",
|
|
29
29
|
position: "relative",
|
|
@@ -51,7 +51,7 @@ function Category({
|
|
|
51
51
|
sx: {
|
|
52
52
|
display: "flex",
|
|
53
53
|
justifyContent: "flex-start",
|
|
54
|
-
maxWidth: "55%"
|
|
54
|
+
maxWidth: isSmallScreen ? "75%" : "55%"
|
|
55
55
|
},
|
|
56
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardElements.CardContent, {
|
|
57
57
|
sx: {
|
|
@@ -85,7 +85,7 @@ function Category({
|
|
|
85
85
|
})]
|
|
86
86
|
}), image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
87
87
|
src: image,
|
|
88
|
-
alt:
|
|
88
|
+
alt: `${categoryTitle} category image`,
|
|
89
89
|
style: {
|
|
90
90
|
position: "absolute",
|
|
91
91
|
bottom: 10,
|
|
@@ -117,6 +117,8 @@ function AppSearch({
|
|
|
117
117
|
const [debouncedSearchText, setDebouncedSearchText] = (0, _react.useState)("");
|
|
118
118
|
const [prevDebouncedSearchText, setPrevDebouncedSearchText] = (0, _react.useState)("");
|
|
119
119
|
const location = (0, _reactRouterDom.useLocation)().pathname;
|
|
120
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
121
|
+
const queryParamsSearchText = queryParams.get('searchText') || '';
|
|
120
122
|
const handleSearchContent = (0, _react.useCallback)(text => {
|
|
121
123
|
const searchQuery = text !== undefined ? text : debouncedSearchText;
|
|
122
124
|
const extraData = {
|
|
@@ -135,6 +137,11 @@ function AppSearch({
|
|
|
135
137
|
setPrevDebouncedSearchText("");
|
|
136
138
|
}
|
|
137
139
|
}, [location, setSearchText, setDebouncedSearchText]);
|
|
140
|
+
(0, _react.useEffect)(() => {
|
|
141
|
+
if (queryParamsSearchText.trim() !== '' && searchText.trim() === '') {
|
|
142
|
+
setSearchText(queryParamsSearchText);
|
|
143
|
+
}
|
|
144
|
+
}, [queryParamsSearchText, setSearchText]);
|
|
138
145
|
(0, _react.useEffect)(() => {
|
|
139
146
|
if (debouncedSearchText && debouncedSearchText !== prevDebouncedSearchText) {
|
|
140
147
|
handleSearchContent();
|
|
@@ -285,7 +292,7 @@ function App({
|
|
|
285
292
|
};
|
|
286
293
|
const isSearchActive = searchText || isMobileSearchExpanded;
|
|
287
294
|
const isTeacher = user && user["custom:role"] === "teach";
|
|
288
|
-
const isUpgradePossible = subscription &&
|
|
295
|
+
const isUpgradePossible = subscription && subscription.isUpgradePossible;
|
|
289
296
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
290
297
|
className: classes.root,
|
|
291
298
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.default, {
|
|
@@ -376,16 +383,7 @@ function App({
|
|
|
376
383
|
onClick: handleClickCreate,
|
|
377
384
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Add.default, {})
|
|
378
385
|
})
|
|
379
|
-
})),
|
|
380
|
-
variant: "contained",
|
|
381
|
-
href: upgradePlanURL,
|
|
382
|
-
size: isLgScreen ? "medium" : "small",
|
|
383
|
-
sx: {
|
|
384
|
-
fontSize: isLgScreen ? null : 12,
|
|
385
|
-
ml: 1
|
|
386
|
-
},
|
|
387
|
-
children: t("upgrade_plan")
|
|
388
|
-
}), isLgScreen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_WhatsNew.default, {
|
|
386
|
+
})), isLgScreen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_WhatsNew.default, {
|
|
389
387
|
t: t,
|
|
390
388
|
whatsNewMarkdown: whatsNewMarkdown,
|
|
391
389
|
whatsNewDate: whatsNewDate
|
|
@@ -472,6 +470,7 @@ function App({
|
|
|
472
470
|
authenticated: authenticated,
|
|
473
471
|
verificationStatus: verificationStatus,
|
|
474
472
|
gameAward: gameAward,
|
|
473
|
+
subscription: subscription,
|
|
475
474
|
...user
|
|
476
475
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomBar.default, {
|
|
477
476
|
navigation: bottomNav,
|
|
@@ -157,6 +157,43 @@ function FeedbackForm({
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
}, [aiGrade]);
|
|
160
|
+
(0, _react.useEffect)(() => {
|
|
161
|
+
const initialSliders = {
|
|
162
|
+
feedback1: [{
|
|
163
|
+
feedbackLevel: 0,
|
|
164
|
+
feedbackLevelName: "Novice Low"
|
|
165
|
+
}],
|
|
166
|
+
feedback2: [{
|
|
167
|
+
feedbackLevel: 0,
|
|
168
|
+
feedbackLevelName: "Novice Low"
|
|
169
|
+
}],
|
|
170
|
+
feedback3: [{
|
|
171
|
+
feedbackLevel: 0,
|
|
172
|
+
feedbackLevelName: "Novice Low"
|
|
173
|
+
}],
|
|
174
|
+
feedback4: [{
|
|
175
|
+
feedbackLevel: 0,
|
|
176
|
+
feedbackLevelName: "Novice Low"
|
|
177
|
+
}],
|
|
178
|
+
feedback5: [{
|
|
179
|
+
feedbackLevel: 0,
|
|
180
|
+
feedbackLevelName: "Novice Low"
|
|
181
|
+
}],
|
|
182
|
+
feedback6: [{
|
|
183
|
+
feedbackLevel: 0,
|
|
184
|
+
feedbackLevelName: "Novice Low"
|
|
185
|
+
}],
|
|
186
|
+
feedbackText: ""
|
|
187
|
+
};
|
|
188
|
+
Object.entries(initialSliders).forEach(([field, value]) => {
|
|
189
|
+
handleChange({
|
|
190
|
+
target: {
|
|
191
|
+
name: field,
|
|
192
|
+
value
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}, [selectedAttendeeName]);
|
|
160
197
|
const marks = [{
|
|
161
198
|
value: 0,
|
|
162
199
|
label: "Novice Low"
|
|
@@ -166,10 +166,11 @@ function TranscriptBox({
|
|
|
166
166
|
title: isWordNearCorrect ? t("word_near_correct") : `${t("pronunciation_score")}: ${wordPronunciationScorePercentage > -1 ? wordPronunciationScorePercentage : 0}%`,
|
|
167
167
|
sx: theme => ({
|
|
168
168
|
marginBottom: 4,
|
|
169
|
+
fontStyle: isWordNearCorrect ? 'italic' : 'normal',
|
|
169
170
|
textDecoration: result === "incorrect" || result === "partially_correct" && !isWordCorrect ? "underline" : "none",
|
|
170
|
-
color: isWordCorrect ? theme.palette.success.dark : isWordNearCorrect ? theme.palette.mode === "light" ? _colors.orange[
|
|
171
|
+
color: isWordCorrect ? theme.palette.success.dark : isWordNearCorrect ? theme.palette.mode === "light" ? _colors.orange[400] : _colors.orange[200] : theme.palette.error.dark,
|
|
171
172
|
...(isWordCorrect && wordPronunciationScorePercentage < 90 && {
|
|
172
|
-
color: theme.palette.mode === "light" ? _colors.orange[
|
|
173
|
+
color: theme.palette.mode === "light" ? _colors.orange[400] : _colors.orange[200],
|
|
173
174
|
fontStyle: "italic"
|
|
174
175
|
})
|
|
175
176
|
}),
|
|
@@ -19,6 +19,7 @@ var _styles = require("@mui/material/styles");
|
|
|
19
19
|
var _index = require("../../utils/index");
|
|
20
20
|
var _NualangVerifiedIcon = _interopRequireDefault(require("../../Misc/NualangVerifiedIcon/NualangVerifiedIcon"));
|
|
21
21
|
var _MedalSelector = _interopRequireDefault(require("../../Misc/MedalSelector/MedalSelector"));
|
|
22
|
+
var _KeyboardDoubleArrowUp = _interopRequireDefault(require("@mui/icons-material/KeyboardDoubleArrowUp"));
|
|
22
23
|
var _nav = _interopRequireDefault(require("../_nav"));
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -90,6 +91,27 @@ const useStyles = (0, _mui.makeStyles)()((theme, {
|
|
|
90
91
|
color: theme.palette.primary.contrastText,
|
|
91
92
|
backgroundColor: `${theme.palette.primary.main} !important`
|
|
92
93
|
},
|
|
94
|
+
upgradeListItem: {
|
|
95
|
+
borderRadius: theme.shape.borderRadius,
|
|
96
|
+
marginBottom: theme.spacing(1),
|
|
97
|
+
textTransform: "capitalize",
|
|
98
|
+
transition: "background-color 0.3s ease-in-out, color 0.3s ease-in-out",
|
|
99
|
+
color: theme.palette.primary.main,
|
|
100
|
+
fontWeight: 500,
|
|
101
|
+
"&:hover": {
|
|
102
|
+
backgroundColor: theme.palette.mode === 'light' ? "#fdedff" : ""
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
upgradeListItemSelected: {
|
|
106
|
+
backgroundColor: `${theme.palette.primary.main} !important`,
|
|
107
|
+
color: `${theme.palette.primary.contrastText} !important`
|
|
108
|
+
},
|
|
109
|
+
upgradeSelectedIcon: {
|
|
110
|
+
color: theme.palette.primary.main
|
|
111
|
+
},
|
|
112
|
+
upgradeIconSelected: {
|
|
113
|
+
color: theme.palette.primary.contrastText
|
|
114
|
+
},
|
|
93
115
|
selectedIcon: {
|
|
94
116
|
color: theme.palette.primary.contrastText
|
|
95
117
|
},
|
|
@@ -107,7 +129,8 @@ function NavItem({
|
|
|
107
129
|
item,
|
|
108
130
|
closeMobileDrawer,
|
|
109
131
|
t,
|
|
110
|
-
isCollapsed
|
|
132
|
+
isCollapsed,
|
|
133
|
+
upgradeItem
|
|
111
134
|
}) {
|
|
112
135
|
const location = (0, _reactRouterDom.useLocation)();
|
|
113
136
|
const {
|
|
@@ -135,13 +158,13 @@ function NavItem({
|
|
|
135
158
|
}
|
|
136
159
|
const listItem = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItem, {
|
|
137
160
|
button: true,
|
|
138
|
-
className: classes.listItem,
|
|
161
|
+
className: upgradeItem ? classes.upgradeListItem : classes.listItem,
|
|
139
162
|
component: component,
|
|
140
163
|
onClick: onClick,
|
|
141
164
|
to: to,
|
|
142
165
|
selected: isSelected,
|
|
143
166
|
classes: {
|
|
144
|
-
selected: classes.listItemSelected
|
|
167
|
+
selected: upgradeItem ? classes.upgradeListItemSelected : classes.listItemSelected
|
|
145
168
|
},
|
|
146
169
|
href: href,
|
|
147
170
|
target: target,
|
|
@@ -150,8 +173,7 @@ function NavItem({
|
|
|
150
173
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
151
174
|
title: t(item.name),
|
|
152
175
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
153
|
-
className: isSelected ? classes.selectedIcon : "",
|
|
154
|
-
"aria-label": undefined,
|
|
176
|
+
className: upgradeItem ? isSelected ? classes.upgradeIconSelected : classes.upgradeSelectedIcon : isSelected ? classes.selectedIcon : "",
|
|
155
177
|
children: item.icon
|
|
156
178
|
})
|
|
157
179
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
@@ -236,8 +258,10 @@ function ResponsiveDrawer({
|
|
|
236
258
|
navToSettings,
|
|
237
259
|
authenticated,
|
|
238
260
|
verificationStatus = "",
|
|
239
|
-
gameAward = ""
|
|
261
|
+
gameAward = "",
|
|
262
|
+
subscription
|
|
240
263
|
}) {
|
|
264
|
+
const isUpgradePossible = subscription && subscription.isUpgradePossible;
|
|
241
265
|
const isGeneratedEmail = (0, _index.checkIsGeneratedEmail)(email);
|
|
242
266
|
const {
|
|
243
267
|
classes
|
|
@@ -450,16 +474,43 @@ function ResponsiveDrawer({
|
|
|
450
474
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Hidden, {
|
|
451
475
|
smDown: true,
|
|
452
476
|
implementation: "js",
|
|
453
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
477
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Drawer, {
|
|
454
478
|
classes: {
|
|
455
479
|
paper: classes.drawerPaper
|
|
456
480
|
},
|
|
457
481
|
variant: "permanent",
|
|
458
482
|
open: true,
|
|
459
|
-
children:
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
483
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
484
|
+
display: "flex",
|
|
485
|
+
flexDirection: "column",
|
|
486
|
+
height: "100%",
|
|
487
|
+
children: [drawer, /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
488
|
+
flexGrow: 1
|
|
489
|
+
}), " ", isUpgradePossible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
490
|
+
sx: {
|
|
491
|
+
overflowY: "auto",
|
|
492
|
+
overflowX: "hidden",
|
|
493
|
+
paddingLeft: theme.spacing(1),
|
|
494
|
+
paddingRight: theme.spacing(1)
|
|
495
|
+
},
|
|
496
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NavItem, {
|
|
497
|
+
index: 0,
|
|
498
|
+
classes: classes,
|
|
499
|
+
Link: Link,
|
|
500
|
+
item: {
|
|
501
|
+
name: "upgrade_plan",
|
|
502
|
+
url: "/settings#Subscription",
|
|
503
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyboardDoubleArrowUp.default, {})
|
|
504
|
+
},
|
|
505
|
+
t: t,
|
|
506
|
+
isCollapsed: isCollapsed,
|
|
507
|
+
upgradeItem: true
|
|
508
|
+
})
|
|
509
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
510
|
+
className: classes.toolbar,
|
|
511
|
+
children: footerIcon(handleCollapseToggle)
|
|
512
|
+
})]
|
|
513
|
+
})
|
|
463
514
|
})
|
|
464
515
|
})]
|
|
465
516
|
});
|
package/dist/Navigation/_nav.js
CHANGED
|
@@ -71,31 +71,13 @@ const navigation = {
|
|
|
71
71
|
url: "/dashboard",
|
|
72
72
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Home.default, {})
|
|
73
73
|
}, {
|
|
74
|
-
name: "
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LibraryBooks.default, {}),
|
|
78
|
-
links: [{
|
|
79
|
-
name: "roleplays",
|
|
80
|
-
url: "/roleplays",
|
|
81
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Forum.default, {})
|
|
82
|
-
}, {
|
|
83
|
-
name: "bots",
|
|
84
|
-
url: "/bots",
|
|
85
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Face.default, {})
|
|
86
|
-
}, {
|
|
87
|
-
name: "courses",
|
|
88
|
-
url: "/courses",
|
|
89
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BubbleChart.default, {})
|
|
90
|
-
}]
|
|
74
|
+
name: "courses",
|
|
75
|
+
url: "/courses",
|
|
76
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BubbleChart.default, {})
|
|
91
77
|
}, {
|
|
92
78
|
name: "classrooms",
|
|
93
79
|
url: "/classrooms",
|
|
94
80
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_School.default, {})
|
|
95
|
-
}, {
|
|
96
|
-
name: "activity",
|
|
97
|
-
url: "/activity",
|
|
98
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Timeline.default, {})
|
|
99
81
|
},
|
|
100
82
|
// {
|
|
101
83
|
// divider: true
|