@contentgrowth/llm-service 0.9.9 → 0.9.91
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.
|
@@ -292,8 +292,11 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
|
|
|
292
292
|
}
|
|
293
293
|
}, [language]);
|
|
294
294
|
const start = (0, import_react2.useCallback)(() => {
|
|
295
|
-
console.log("[useSpeechRecognition] start() called");
|
|
296
|
-
if (isSimulatingRef.current)
|
|
295
|
+
console.log("[useSpeechRecognition] start() called. isListening:", isListening, "isStarting:", isStartingRef.current, "hasInstance:", !!recognitionRef.current);
|
|
296
|
+
if (isSimulatingRef.current) {
|
|
297
|
+
console.log("[useSpeechRecognition] isSimulating, ignoring start");
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
297
300
|
if (!recognitionRef.current) {
|
|
298
301
|
console.error("[useSpeechRecognition] Recognition instance missing");
|
|
299
302
|
return;
|
|
@@ -303,7 +306,7 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
|
|
|
303
306
|
return;
|
|
304
307
|
}
|
|
305
308
|
if (recognitionRef.current.isListening) {
|
|
306
|
-
console.warn("[useSpeechRecognition] Already listening - ignoring");
|
|
309
|
+
console.warn("[useSpeechRecognition] Already listening (native prop) - ignoring");
|
|
307
310
|
}
|
|
308
311
|
if (isListening) {
|
|
309
312
|
console.warn("[useSpeechRecognition] App state says already listening - ignoring");
|
|
@@ -313,7 +316,7 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
|
|
|
313
316
|
setTranscript("");
|
|
314
317
|
isStartingRef.current = true;
|
|
315
318
|
recognitionRef.current.start();
|
|
316
|
-
console.log("[useSpeechRecognition] recognition.start() executed");
|
|
319
|
+
console.log("[useSpeechRecognition] recognition.start() executed successfully");
|
|
317
320
|
} catch (error2) {
|
|
318
321
|
isStartingRef.current = false;
|
|
319
322
|
console.error("[useSpeechRecognition] Failed to start recognition:", error2);
|
|
@@ -948,7 +951,12 @@ var TapToTalk = ({
|
|
|
948
951
|
const isListening = !!voiceTrigger || nativeSpeech.isListening || customRecorder.isRecording;
|
|
949
952
|
const isActive = isListening || isTranscribing;
|
|
950
953
|
const processingRef = (0, import_react6.useRef)(false);
|
|
951
|
-
const toggleVoice = async () => {
|
|
954
|
+
const toggleVoice = async (e) => {
|
|
955
|
+
if (e) {
|
|
956
|
+
e.preventDefault();
|
|
957
|
+
e.stopPropagation();
|
|
958
|
+
}
|
|
959
|
+
console.trace("[TapToTalk] toggleVoice called trace");
|
|
952
960
|
if (processingRef.current) {
|
|
953
961
|
console.log("[TapToTalk] toggleVoice ignored - processing");
|
|
954
962
|
return;
|
|
@@ -989,12 +997,17 @@ var TapToTalk = ({
|
|
|
989
997
|
} else {
|
|
990
998
|
console.log("[TapToTalk] Starting voice...");
|
|
991
999
|
setErrorMsg(null);
|
|
992
|
-
|
|
1000
|
+
if (onFocusTarget) {
|
|
1001
|
+
console.log("[TapToTalk] calling onFocusTarget() - this might trigger keyboard");
|
|
1002
|
+
onFocusTarget();
|
|
1003
|
+
} else {
|
|
1004
|
+
console.log("[TapToTalk] onFocusTarget is undefined");
|
|
1005
|
+
}
|
|
993
1006
|
setVoiceTrigger("click");
|
|
994
1007
|
if ((voiceConfig == null ? void 0 : voiceConfig.mode) === "custom") {
|
|
995
1008
|
try {
|
|
996
1009
|
await customRecorder.start();
|
|
997
|
-
} catch (
|
|
1010
|
+
} catch (e2) {
|
|
998
1011
|
setErrorMsg("Mic access denied");
|
|
999
1012
|
setVoiceTrigger(null);
|
|
1000
1013
|
}
|