@nualang/nualang-ui-components 0.1.1149 → 0.1.1150

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.
@@ -302,7 +302,7 @@ function Pronouncer({
302
302
  setChecked
303
303
  } = exerciseState;
304
304
  (0, _react.useEffect)(() => {
305
- if (currentPhrase.phrase) {
305
+ if (currentPhrase?.phrase) {
306
306
  setCurrentPhraseText(currentPhrase.phrase);
307
307
  }
308
308
  }, [currentPhrase]);
@@ -448,7 +448,7 @@ function RoleplayGame({
448
448
  }, [actorHasBeenSelected]);
449
449
  const nextScriptLine = roleplay && scriptWithoutQuestions && scriptWithoutQuestions[roleplayMessages.length] ? scriptWithoutQuestions[roleplayMessages.length] : "";
450
450
  (0, _react.useEffect)(() => {
451
- if (nextScriptLine) {
451
+ if (nextScriptLine?.text) {
452
452
  setCurrentPhraseText(nextScriptLine.text);
453
453
  }
454
454
  }, [nextScriptLine]);
@@ -446,7 +446,7 @@ function RoleplayGame({
446
446
  }, [actorHasBeenSelected]);
447
447
  const nextScriptLine = roleplay && scriptWithoutQuestions && scriptWithoutQuestions[roleplayMessages.length] ? scriptWithoutQuestions[roleplayMessages.length] : "";
448
448
  (0, _react.useEffect)(() => {
449
- if (nextScriptLine) {
449
+ if (nextScriptLine?.text) {
450
450
  setCurrentPhraseText(nextScriptLine.text);
451
451
  }
452
452
  }, [nextScriptLine]);
@@ -100,7 +100,7 @@ const TableHead = (0, _styles.styled)("thead")(({
100
100
  },
101
101
  "& th:first-child": {
102
102
  left: 0,
103
- zIndex: 3,
103
+ zIndex: 4,
104
104
  "@media print": {
105
105
  position: "relative"
106
106
  }
@@ -40,13 +40,14 @@ const constraints = {
40
40
  audio: true,
41
41
  video: false
42
42
  };
43
- function useRecognition({
44
- currentPhraseText,
45
- trackRecommendedEvent,
46
- learnLang,
47
- exerciseName,
48
- gameId
49
- }) {
43
+ function useRecognition(props = {}) {
44
+ const {
45
+ currentPhraseText,
46
+ trackRecommendedEvent,
47
+ learnLang,
48
+ exerciseName,
49
+ gameId
50
+ } = props;
50
51
  const browserSupportsSpeechRecognition = true;
51
52
  const [recognitionState, setRecognitionState] = (0, _react.useState)({
52
53
  interimTranscript: "",
@@ -202,7 +203,6 @@ function useRecognition({
202
203
  A8_learn_language: `${learnLang}`,
203
204
  A9_exercise: gameId ? `${exerciseName}-${gameId}` : `${exerciseName}`
204
205
  };
205
- console.log("Event Body:", eventBody);
206
206
  trackRecommendedEvent("speech_recognition_no_transcript", eventBody);
207
207
  };
208
208
  const stopRecording = (keepSocketAlive, triggerEvent) => {
@@ -225,7 +225,6 @@ function useRecognition({
225
225
  } = recognitionState;
226
226
  if (triggerEvent && (!finalTranscript || finalTranscript === "") && (!interimTranscript || interimTranscript === "")) {
227
227
  captureSpeechRecognitionNoTranscript().catch(console.error);
228
- console.log("Event triggered");
229
228
  }
230
229
  }, 2000);
231
230
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1149",
3
+ "version": "0.1.1150",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",