@axiom-lattice/react-sdk 2.1.117 → 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 +29 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -16997,7 +16997,7 @@ function useVoiceRecorder(options) {
|
|
|
16997
16997
|
setState((prev) => ({
|
|
16998
16998
|
...prev,
|
|
16999
16999
|
status: "idle",
|
|
17000
|
-
error: { type: "not_supported", message: "
|
|
17000
|
+
error: { type: "not_supported", message: "Voice input not supported. Use Chrome, Edge, or Safari." }
|
|
17001
17001
|
}));
|
|
17002
17002
|
return;
|
|
17003
17003
|
}
|
|
@@ -17016,7 +17016,7 @@ function useVoiceRecorder(options) {
|
|
|
17016
17016
|
setState((prev) => ({
|
|
17017
17017
|
...prev,
|
|
17018
17018
|
status: "idle",
|
|
17019
|
-
error: { type: "not_supported", message: "
|
|
17019
|
+
error: { type: "not_supported", message: "Audio recording format not supported in this browser." }
|
|
17020
17020
|
}));
|
|
17021
17021
|
return;
|
|
17022
17022
|
}
|
|
@@ -17089,7 +17089,7 @@ function useVoiceRecorder(options) {
|
|
|
17089
17089
|
}).catch((err) => {
|
|
17090
17090
|
if (!cleanedRef.current) {
|
|
17091
17091
|
console.error("STT auto upload failed:", err);
|
|
17092
|
-
const errorMessage = err instanceof Error ? err.message : "
|
|
17092
|
+
const errorMessage = err instanceof Error ? err.message : "Transcription failed";
|
|
17093
17093
|
setState((prev) => ({
|
|
17094
17094
|
...prev,
|
|
17095
17095
|
error: { type: "upload_failed", message: errorMessage }
|
|
@@ -17133,7 +17133,7 @@ function useVoiceRecorder(options) {
|
|
|
17133
17133
|
setState((prev) => ({
|
|
17134
17134
|
...prev,
|
|
17135
17135
|
status: "idle",
|
|
17136
|
-
error: { type: "recorder_error", message: "
|
|
17136
|
+
error: { type: "recorder_error", message: "Recording failed, please try again." }
|
|
17137
17137
|
}));
|
|
17138
17138
|
};
|
|
17139
17139
|
recorder.start(timeslice);
|
|
@@ -17142,7 +17142,7 @@ function useVoiceRecorder(options) {
|
|
|
17142
17142
|
setState((prev) => ({
|
|
17143
17143
|
...prev,
|
|
17144
17144
|
status: "idle",
|
|
17145
|
-
error: { type: "recorder_error", message: "
|
|
17145
|
+
error: { type: "recorder_error", message: "Recording initialization failed." }
|
|
17146
17146
|
}));
|
|
17147
17147
|
return;
|
|
17148
17148
|
}
|
|
@@ -17173,7 +17173,7 @@ function useVoiceRecorder(options) {
|
|
|
17173
17173
|
status: "idle",
|
|
17174
17174
|
error: {
|
|
17175
17175
|
type: "permission_denied",
|
|
17176
|
-
message: isPermission ? "
|
|
17176
|
+
message: isPermission ? "Please allow microphone access in browser settings" : "Cannot access microphone"
|
|
17177
17177
|
}
|
|
17178
17178
|
}));
|
|
17179
17179
|
}
|
|
@@ -17191,7 +17191,7 @@ function useVoiceRecorder(options) {
|
|
|
17191
17191
|
...prev,
|
|
17192
17192
|
status: "idle",
|
|
17193
17193
|
voiceLevel: 0,
|
|
17194
|
-
error: { type: "upload_failed", message: "
|
|
17194
|
+
error: { type: "upload_failed", message: "Stop recording timed out" }
|
|
17195
17195
|
}));
|
|
17196
17196
|
}, 1e4);
|
|
17197
17197
|
}, [cleanupAudio]);
|
|
@@ -17228,7 +17228,7 @@ function useVoiceRecorder(options) {
|
|
|
17228
17228
|
setState((prev) => ({ ...prev, status: "idle", voiceLevel: 0 }));
|
|
17229
17229
|
} catch (err) {
|
|
17230
17230
|
console.error("[STT] upload failed:", err);
|
|
17231
|
-
const message39 = err instanceof Error ? err.message : "
|
|
17231
|
+
const message39 = err instanceof Error ? err.message : "Transcription failed";
|
|
17232
17232
|
cleanupAudio();
|
|
17233
17233
|
setState((prev) => ({
|
|
17234
17234
|
...prev,
|
|
@@ -17258,7 +17258,7 @@ function useVoiceRecorder(options) {
|
|
|
17258
17258
|
if (text) onTranscriptionRef.current(text);
|
|
17259
17259
|
setState((prev) => ({ ...prev, status: "idle", voiceLevel: 0 }));
|
|
17260
17260
|
} catch (err) {
|
|
17261
|
-
const message39 = err instanceof Error ? err.message : "
|
|
17261
|
+
const message39 = err instanceof Error ? err.message : "Retry failed";
|
|
17262
17262
|
setState((prev) => ({
|
|
17263
17263
|
...prev,
|
|
17264
17264
|
status: "idle",
|
|
@@ -23473,25 +23473,25 @@ var VoiceInputButton = ({
|
|
|
23473
23473
|
};
|
|
23474
23474
|
const isBusy = isUploading || isRequesting;
|
|
23475
23475
|
const getAriaLabel = () => {
|
|
23476
|
-
if (noSttModel) return "
|
|
23477
|
-
if (isBusy) return "
|
|
23478
|
-
if (hasError && isIdle) return isRetryableError ? "
|
|
23479
|
-
if (isRecording) return state.mode === "auto" ?
|
|
23480
|
-
return "
|
|
23476
|
+
if (noSttModel) return "Voice input unavailable: No STT model configured";
|
|
23477
|
+
if (isBusy) return "Transcribing...";
|
|
23478
|
+
if (hasError && isIdle) return isRetryableError ? "Transcription failed, tap to retry" : "Tap to re-record";
|
|
23479
|
+
if (isRecording) return state.mode === "auto" ? `Stop recording (${state.duration}s, ${state.partialTexts.length} segments transcribed)` : `Stop recording (${state.duration}s)`;
|
|
23480
|
+
return "Start voice input";
|
|
23481
23481
|
};
|
|
23482
23482
|
const getTitle = () => {
|
|
23483
|
-
if (noSttModel) return "
|
|
23484
|
-
if (isBusy) return "
|
|
23485
|
-
if (hasError && isIdle) return isRetryableError ? "
|
|
23483
|
+
if (noSttModel) return "No STT model configured";
|
|
23484
|
+
if (isBusy) return "Uploading...";
|
|
23485
|
+
if (hasError && isIdle) return isRetryableError ? "Transcription failed, tap to retry" : "Tap to re-record";
|
|
23486
23486
|
if (isRecording) {
|
|
23487
23487
|
const mins = Math.floor(state.duration / 60);
|
|
23488
23488
|
const secs = state.duration % 60;
|
|
23489
23489
|
const time = `${String(mins).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
|
|
23490
|
-
const mode = isAutoMode ? "
|
|
23491
|
-
const chunks = state.partialTexts.length > 0 ? `
|
|
23492
|
-
return `${mode}
|
|
23490
|
+
const mode = isAutoMode ? "Auto" : "Manual";
|
|
23491
|
+
const chunks = state.partialTexts.length > 0 ? ` ${state.partialTexts.length} segments` : "";
|
|
23492
|
+
return `${mode} mode, recording ${time}${chunks} \u2014 tap to stop`;
|
|
23493
23493
|
}
|
|
23494
|
-
return "
|
|
23494
|
+
return "Start voice input";
|
|
23495
23495
|
};
|
|
23496
23496
|
return /* @__PURE__ */ jsx91(
|
|
23497
23497
|
Button47,
|
|
@@ -43722,6 +43722,14 @@ var ShellContent = ({
|
|
|
43722
43722
|
};
|
|
43723
43723
|
var LatticeChatShell = (props) => {
|
|
43724
43724
|
const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
|
|
43725
|
+
console.log(
|
|
43726
|
+
"[LatticeChatShell] props.initialConfig?.assistantId:",
|
|
43727
|
+
props.initialConfig?.assistantId,
|
|
43728
|
+
"restProps.initialConfig?.assistantId:",
|
|
43729
|
+
restProps.initialConfig?.assistantId,
|
|
43730
|
+
"restProps keys:",
|
|
43731
|
+
Object.keys(restProps)
|
|
43732
|
+
);
|
|
43725
43733
|
const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
|
|
43726
43734
|
return /* @__PURE__ */ jsx166(
|
|
43727
43735
|
LatticeChatShellContextProvider,
|