@axiom-lattice/react-sdk 2.1.118 → 2.1.119
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/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16927,7 +16927,7 @@ function useVoiceRecorder(options) {
|
|
|
16927
16927
|
setState((prev) => ({
|
|
16928
16928
|
...prev,
|
|
16929
16929
|
status: "idle",
|
|
16930
|
-
error: { type: "not_supported", message: "
|
|
16930
|
+
error: { type: "not_supported", message: "Voice input not supported. Use Chrome, Edge, or Safari." }
|
|
16931
16931
|
}));
|
|
16932
16932
|
return;
|
|
16933
16933
|
}
|
|
@@ -16946,7 +16946,7 @@ function useVoiceRecorder(options) {
|
|
|
16946
16946
|
setState((prev) => ({
|
|
16947
16947
|
...prev,
|
|
16948
16948
|
status: "idle",
|
|
16949
|
-
error: { type: "not_supported", message: "
|
|
16949
|
+
error: { type: "not_supported", message: "Audio recording format not supported in this browser." }
|
|
16950
16950
|
}));
|
|
16951
16951
|
return;
|
|
16952
16952
|
}
|
|
@@ -17019,7 +17019,7 @@ function useVoiceRecorder(options) {
|
|
|
17019
17019
|
}).catch((err) => {
|
|
17020
17020
|
if (!cleanedRef.current) {
|
|
17021
17021
|
console.error("STT auto upload failed:", err);
|
|
17022
|
-
const errorMessage = err instanceof Error ? err.message : "
|
|
17022
|
+
const errorMessage = err instanceof Error ? err.message : "Transcription failed";
|
|
17023
17023
|
setState((prev) => ({
|
|
17024
17024
|
...prev,
|
|
17025
17025
|
error: { type: "upload_failed", message: errorMessage }
|
|
@@ -17063,7 +17063,7 @@ function useVoiceRecorder(options) {
|
|
|
17063
17063
|
setState((prev) => ({
|
|
17064
17064
|
...prev,
|
|
17065
17065
|
status: "idle",
|
|
17066
|
-
error: { type: "recorder_error", message: "
|
|
17066
|
+
error: { type: "recorder_error", message: "Recording failed, please try again." }
|
|
17067
17067
|
}));
|
|
17068
17068
|
};
|
|
17069
17069
|
recorder.start(timeslice);
|
|
@@ -17072,7 +17072,7 @@ function useVoiceRecorder(options) {
|
|
|
17072
17072
|
setState((prev) => ({
|
|
17073
17073
|
...prev,
|
|
17074
17074
|
status: "idle",
|
|
17075
|
-
error: { type: "recorder_error", message: "
|
|
17075
|
+
error: { type: "recorder_error", message: "Recording initialization failed." }
|
|
17076
17076
|
}));
|
|
17077
17077
|
return;
|
|
17078
17078
|
}
|
|
@@ -17103,7 +17103,7 @@ function useVoiceRecorder(options) {
|
|
|
17103
17103
|
status: "idle",
|
|
17104
17104
|
error: {
|
|
17105
17105
|
type: "permission_denied",
|
|
17106
|
-
message: isPermission ? "
|
|
17106
|
+
message: isPermission ? "Please allow microphone access in browser settings" : "Cannot access microphone"
|
|
17107
17107
|
}
|
|
17108
17108
|
}));
|
|
17109
17109
|
}
|
|
@@ -17121,7 +17121,7 @@ function useVoiceRecorder(options) {
|
|
|
17121
17121
|
...prev,
|
|
17122
17122
|
status: "idle",
|
|
17123
17123
|
voiceLevel: 0,
|
|
17124
|
-
error: { type: "upload_failed", message: "
|
|
17124
|
+
error: { type: "upload_failed", message: "Stop recording timed out" }
|
|
17125
17125
|
}));
|
|
17126
17126
|
}, 1e4);
|
|
17127
17127
|
}, [cleanupAudio]);
|
|
@@ -17158,7 +17158,7 @@ function useVoiceRecorder(options) {
|
|
|
17158
17158
|
setState((prev) => ({ ...prev, status: "idle", voiceLevel: 0 }));
|
|
17159
17159
|
} catch (err) {
|
|
17160
17160
|
console.error("[STT] upload failed:", err);
|
|
17161
|
-
const message39 = err instanceof Error ? err.message : "
|
|
17161
|
+
const message39 = err instanceof Error ? err.message : "Transcription failed";
|
|
17162
17162
|
cleanupAudio();
|
|
17163
17163
|
setState((prev) => ({
|
|
17164
17164
|
...prev,
|
|
@@ -17188,7 +17188,7 @@ function useVoiceRecorder(options) {
|
|
|
17188
17188
|
if (text) onTranscriptionRef.current(text);
|
|
17189
17189
|
setState((prev) => ({ ...prev, status: "idle", voiceLevel: 0 }));
|
|
17190
17190
|
} catch (err) {
|
|
17191
|
-
const message39 = err instanceof Error ? err.message : "
|
|
17191
|
+
const message39 = err instanceof Error ? err.message : "Retry failed";
|
|
17192
17192
|
setState((prev) => ({
|
|
17193
17193
|
...prev,
|
|
17194
17194
|
status: "idle",
|
|
@@ -23297,25 +23297,25 @@ var VoiceInputButton = ({
|
|
|
23297
23297
|
};
|
|
23298
23298
|
const isBusy = isUploading || isRequesting;
|
|
23299
23299
|
const getAriaLabel = () => {
|
|
23300
|
-
if (noSttModel) return "
|
|
23301
|
-
if (isBusy) return "
|
|
23302
|
-
if (hasError && isIdle) return isRetryableError ? "
|
|
23303
|
-
if (isRecording) return state.mode === "auto" ?
|
|
23304
|
-
return "
|
|
23300
|
+
if (noSttModel) return "Voice input unavailable: No STT model configured";
|
|
23301
|
+
if (isBusy) return "Transcribing...";
|
|
23302
|
+
if (hasError && isIdle) return isRetryableError ? "Transcription failed, tap to retry" : "Tap to re-record";
|
|
23303
|
+
if (isRecording) return state.mode === "auto" ? `Stop recording (${state.duration}s, ${state.partialTexts.length} segments transcribed)` : `Stop recording (${state.duration}s)`;
|
|
23304
|
+
return "Start voice input";
|
|
23305
23305
|
};
|
|
23306
23306
|
const getTitle = () => {
|
|
23307
|
-
if (noSttModel) return "
|
|
23308
|
-
if (isBusy) return "
|
|
23309
|
-
if (hasError && isIdle) return isRetryableError ? "
|
|
23307
|
+
if (noSttModel) return "No STT model configured";
|
|
23308
|
+
if (isBusy) return "Uploading...";
|
|
23309
|
+
if (hasError && isIdle) return isRetryableError ? "Transcription failed, tap to retry" : "Tap to re-record";
|
|
23310
23310
|
if (isRecording) {
|
|
23311
23311
|
const mins = Math.floor(state.duration / 60);
|
|
23312
23312
|
const secs = state.duration % 60;
|
|
23313
23313
|
const time = `${String(mins).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
|
|
23314
|
-
const mode = isAutoMode ? "
|
|
23315
|
-
const chunks = state.partialTexts.length > 0 ? `
|
|
23316
|
-
return `${mode}
|
|
23314
|
+
const mode = isAutoMode ? "Auto" : "Manual";
|
|
23315
|
+
const chunks = state.partialTexts.length > 0 ? ` ${state.partialTexts.length} segments` : "";
|
|
23316
|
+
return `${mode} mode, recording ${time}${chunks} \u2014 tap to stop`;
|
|
23317
23317
|
}
|
|
23318
|
-
return "
|
|
23318
|
+
return "Start voice input";
|
|
23319
23319
|
};
|
|
23320
23320
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
23321
23321
|
import_antd72.Button,
|