@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 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: "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u8F93\u5165\uFF0C\u8BF7\u4F7F\u7528 Chrome/Edge/Safari" }
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: "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u5F55\u97F3\u683C\u5F0F" }
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 : "\u8F6C\u5199\u5931\u8D25";
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: "\u5F55\u97F3\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5" }
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: "\u5F55\u97F3\u521D\u59CB\u5316\u5931\u8D25" }
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 ? "\u8BF7\u5728\u6D4F\u89C8\u5668\u8BBE\u7F6E\u4E2D\u5141\u8BB8\u9EA6\u514B\u98CE\u8BBF\u95EE" : "\u65E0\u6CD5\u8BBF\u95EE\u9EA6\u514B\u98CE"
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: "\u505C\u6B62\u5F55\u97F3\u8D85\u65F6" }
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 : "\u8F6C\u5199\u5931\u8D25";
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 : "\u91CD\u8BD5\u5931\u8D25";
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 "\u8BED\u97F3\u8F93\u5165\u4E0D\u53EF\u7528\uFF1A\u672A\u914D\u7F6E\u8BED\u97F3\u8BC6\u522B\u6A21\u578B";
23301
- if (isBusy) return "\u8F6C\u5199\u4E2D";
23302
- if (hasError && isIdle) return isRetryableError ? "\u8F6C\u5199\u5931\u8D25, \u70B9\u51FB\u91CD\u8BD5" : "\u70B9\u51FB\u91CD\u65B0\u5F55\u97F3";
23303
- if (isRecording) return state.mode === "auto" ? `\u505C\u6B62\u5F55\u97F3\uFF08${state.duration}\u79D2, \u5DF2\u8F6C\u5199${state.partialTexts.length}\u6BB5\uFF09` : `\u505C\u6B62\u5F55\u97F3\uFF08${state.duration}\u79D2\uFF09`;
23304
- return "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165";
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 "\u672A\u914D\u7F6E\u8BED\u97F3\u8BC6\u522B\u6A21\u578B";
23308
- if (isBusy) return "\u4E0A\u4F20\u4E2D...";
23309
- if (hasError && isIdle) return isRetryableError ? "\u8F6C\u5199\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5" : "\u70B9\u51FB\u91CD\u65B0\u5F55\u97F3";
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 ? "\u81EA\u52A8" : "\u624B\u52A8";
23315
- const chunks = state.partialTexts.length > 0 ? ` \u5DF2\u8F6C\u5199${state.partialTexts.length}\u6BB5` : "";
23316
- return `${mode}\u6A21\u5F0F \u5F55\u97F3\u4E2D ${time}${chunks} \u2014 \u70B9\u51FB\u505C\u6B62`;
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 "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165";
23318
+ return "Start voice input";
23319
23319
  };
23320
23320
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23321
23321
  import_antd72.Button,