@contentgrowth/llm-service 0.9.93 → 0.9.94

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.
@@ -759,7 +759,7 @@ var ChatInputArea = (0, import_react5.forwardRef)(({
759
759
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || "ontouchstart" in window || navigator.maxTouchPoints > 0;
760
760
  }, []);
761
761
  const startRecording = async (trigger) => {
762
- var _a2;
762
+ var _a2, _b2;
763
763
  console.log("[ChatInputArea] startRecording called. trigger:", trigger, "isMobile:", isMobile());
764
764
  console.log("[ChatInputArea] Current state - voiceTrigger:", voiceTrigger, "isTranscribing:", isTranscribing);
765
765
  if (voiceTrigger || isTranscribing) {
@@ -768,8 +768,6 @@ var ChatInputArea = (0, import_react5.forwardRef)(({
768
768
  }
769
769
  setVoiceTrigger(trigger);
770
770
  setVoiceError(null);
771
- console.log("[ChatInputArea] Calling voiceConfig.onVoiceStart if exists...");
772
- (_a2 = voiceConfig == null ? void 0 : voiceConfig.onVoiceStart) == null ? void 0 : _a2.call(voiceConfig);
773
771
  if ((voiceConfig == null ? void 0 : voiceConfig.mode) === "native") {
774
772
  console.log("[ChatInputArea] Using native speech recognition");
775
773
  if (!nativeSpeech.isSupported) {
@@ -781,8 +779,22 @@ var ChatInputArea = (0, import_react5.forwardRef)(({
781
779
  console.log("[ChatInputArea] Calling nativeSpeech.start()...");
782
780
  nativeSpeech.start();
783
781
  console.log("[ChatInputArea] nativeSpeech.start() called");
782
+ console.log("[ChatInputArea] Calling voiceConfig.onVoiceStart if exists (after nativeSpeech.start)...");
783
+ try {
784
+ (_a2 = voiceConfig == null ? void 0 : voiceConfig.onVoiceStart) == null ? void 0 : _a2.call(voiceConfig);
785
+ console.log("[ChatInputArea] voiceConfig.onVoiceStart completed");
786
+ } catch (e) {
787
+ console.error("[ChatInputArea] voiceConfig.onVoiceStart threw error", e);
788
+ }
784
789
  } else {
785
790
  console.log("[ChatInputArea] Using custom recorder");
791
+ console.log("[ChatInputArea] Calling voiceConfig.onVoiceStart if exists (custom mode)...");
792
+ try {
793
+ (_b2 = voiceConfig == null ? void 0 : voiceConfig.onVoiceStart) == null ? void 0 : _b2.call(voiceConfig);
794
+ console.log("[ChatInputArea] voiceConfig.onVoiceStart completed");
795
+ } catch (e) {
796
+ console.error("[ChatInputArea] voiceConfig.onVoiceStart threw error", e);
797
+ }
786
798
  await customRecorder.start();
787
799
  console.log("[ChatInputArea] Custom recorder started");
788
800
  }
@@ -794,6 +806,10 @@ var ChatInputArea = (0, import_react5.forwardRef)(({
794
806
  }, 0);
795
807
  } else {
796
808
  console.log("[ChatInputArea] SKIPPING textarea focus on mobile to prevent keyboard conflict");
809
+ if (document.activeElement instanceof HTMLElement) {
810
+ console.log("[ChatInputArea] Blur active element on mobile");
811
+ document.activeElement.blur();
812
+ }
797
813
  }
798
814
  };
799
815
  const stopRecording = () => {
@@ -1136,10 +1152,14 @@ var TapToTalk = ({
1136
1152
  if (onFocusTarget && !isMobile()) {
1137
1153
  console.log("[TapToTalk] calling onFocusTarget() (desktop only)");
1138
1154
  onFocusTarget();
1139
- } else if (onFocusTarget) {
1140
- console.log("[TapToTalk] SKIPPING onFocusTarget on mobile to prevent keyboard conflict");
1141
1155
  } else {
1142
- console.log("[TapToTalk] onFocusTarget is undefined");
1156
+ if (onFocusTarget) {
1157
+ console.log("[TapToTalk] SKIPPING onFocusTarget on mobile to prevent keyboard conflict");
1158
+ }
1159
+ if (isMobile() && document.activeElement instanceof HTMLElement) {
1160
+ console.log("[TapToTalk] Blurring active element on mobile");
1161
+ document.activeElement.blur();
1162
+ }
1143
1163
  }
1144
1164
  setVoiceTrigger("click");
1145
1165
  console.log("[TapToTalk] voiceTrigger set to click");