@nualang/nualang-ui-components 0.1.1206 → 0.1.1208
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.
|
@@ -86,7 +86,7 @@ const PlanFeaturesListItem = (0, _system.styled)("li")(({
|
|
|
86
86
|
theme
|
|
87
87
|
}) => ({
|
|
88
88
|
display: "flex",
|
|
89
|
-
marginTop: theme.spacing(
|
|
89
|
+
marginTop: theme.spacing(2)
|
|
90
90
|
}));
|
|
91
91
|
const PlanFeaturesListItemLabel = (0, _system.styled)(_material.Typography)(() => ({
|
|
92
92
|
display: "flex",
|
|
@@ -116,7 +116,7 @@ const Badge = (0, _system.styled)(_material.Typography)(({
|
|
|
116
116
|
color: theme.palette.common.black,
|
|
117
117
|
fontSize: theme.typography.pxToRem(10),
|
|
118
118
|
borderRadius: "9px",
|
|
119
|
-
padding:
|
|
119
|
+
padding: theme.spacing(0.25, 1),
|
|
120
120
|
display: "flex",
|
|
121
121
|
alignItems: "center",
|
|
122
122
|
marginBottom: "2px"
|
|
@@ -188,7 +188,7 @@ function SubscriptionPlan({
|
|
|
188
188
|
currency
|
|
189
189
|
}) {
|
|
190
190
|
const [displayPlan, setDisplayPlan] = (0, _react.useState)(plan);
|
|
191
|
-
const [buyNowDisabled, setBuyNowDisabled] = (0, _react.useState)(true);
|
|
191
|
+
const [buyNowDisabled, setBuyNowDisabled] = (0, _react.useState)(plan?.planVersions?.length > 0 ? true : false);
|
|
192
192
|
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
193
193
|
const open = Boolean(anchorEl);
|
|
194
194
|
const [disableRippleEff, setDisableRippleEff] = (0, _react.useState)(false);
|
|
@@ -307,8 +307,9 @@ function SubscriptionPlan({
|
|
|
307
307
|
onClick: () => plan.button.onClick(),
|
|
308
308
|
bgPrimary: plan.bgPrimary,
|
|
309
309
|
children: plan.button.buttonText
|
|
310
|
-
}),
|
|
311
|
-
|
|
310
|
+
}), displayPlan && billingPeriod && currency && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
311
|
+
mt: 2,
|
|
312
|
+
children: [plan.planVersions && displayPlan.subButton && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
312
313
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PlanButton, {
|
|
313
314
|
id: "plan-button",
|
|
314
315
|
fullWidth: true,
|
|
@@ -248,24 +248,23 @@ function AnswerResult({
|
|
|
248
248
|
};
|
|
249
249
|
}) : [];
|
|
250
250
|
const correctWordsArray = exercise === "roleplay" ? nextScriptLine?.text?.split(" ") : currentPhrase && currentPhrase.phrase ? (0, _utils.removeExtraWhiteSpaces)(currentPhrase.phrase).split(" ") : [];
|
|
251
|
+
const handlePronunciationCheck = (word, phraseWordListIndex) => {
|
|
252
|
+
if (exercise === "pronunciation") {
|
|
253
|
+
return checkIsPronunciationCorrect(word.trim(), {
|
|
254
|
+
phrase: phraseWordList[phraseWordListIndex].trim(),
|
|
255
|
+
alternativeVersions: currentPhrase.alternativeVersions ? currentPhrase.alternativeVersions.map(altAns => {
|
|
256
|
+
return altAns ? (0, _utils.removeExtraWhiteSpaces)(altAns).split(" ")[phraseWordListIndex] : "";
|
|
257
|
+
}) : []
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
return checkIsPronunciationCorrect(word.trim(), phraseWordList[phraseWordListIndex].trim());
|
|
261
|
+
}
|
|
262
|
+
};
|
|
251
263
|
const transcriptArray = transcript.split(" ").map((word, i) => {
|
|
252
|
-
const isWordCorrect = phraseWordList[i] && (
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}) : []
|
|
257
|
-
}) : checkIsPronunciationCorrect(word.trim(), phraseWordList[i].trim()));
|
|
258
|
-
const isWordNearCorrect = !isWordCorrect && (phraseWordList[i - 1] && checkIsPronunciationCorrect(word.trim(), {
|
|
259
|
-
phrase: phraseWordList[i - 1].trim(),
|
|
260
|
-
alternativeVersions: currentPhrase.alternativeVersions ? currentPhrase.alternativeVersions.map(altAns => {
|
|
261
|
-
return altAns ? (0, _utils.removeExtraWhiteSpaces)(altAns).split(" ")[i - 1] : "";
|
|
262
|
-
}) : []
|
|
263
|
-
}) || phraseWordList[i + 1] && checkIsPronunciationCorrect(word.trim(), {
|
|
264
|
-
phrase: phraseWordList[i + 1].trim(),
|
|
265
|
-
alternativeVersions: currentPhrase.alternativeVersions ? currentPhrase.alternativeVersions.map(altAns => {
|
|
266
|
-
return altAns ? (0, _utils.removeExtraWhiteSpaces)(altAns).split(" ")[i + 1] : "";
|
|
267
|
-
}) : []
|
|
268
|
-
}));
|
|
264
|
+
const isWordCorrect = phraseWordList[i] && handlePronunciationCheck(word, i);
|
|
265
|
+
const isPreviousWordCorrect = !isWordCorrect && phraseWordList[i - 1] && handlePronunciationCheck(word, i - 1);
|
|
266
|
+
const isNextWordCorrect = !isWordCorrect && phraseWordList[i + 1] && handlePronunciationCheck(word, i + 1);
|
|
267
|
+
const isWordNearCorrect = !isWordCorrect && (isPreviousWordCorrect || isNextWordCorrect);
|
|
269
268
|
const wordIndex = (transcriptWords || []).findIndex(w => w.word === word.trim());
|
|
270
269
|
let wordPronunciationScore = null;
|
|
271
270
|
let wordPronunciationScorePercentage = null;
|