sera-ai 1.0.4 → 1.0.6

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.d.mts CHANGED
@@ -46,6 +46,8 @@ interface AudioDictationProps {
46
46
  specialty?: string;
47
47
  selectedFormat?: "json" | "hl7" | "fhir";
48
48
  onDictationComplete: (message: string) => void;
49
+ onDictationStart?: () => void;
50
+ onProcessingStart?: () => void;
49
51
  className?: string;
50
52
  style?: React$1.CSSProperties;
51
53
  buttonText?: string;
package/dist/index.d.ts CHANGED
@@ -46,6 +46,8 @@ interface AudioDictationProps {
46
46
  specialty?: string;
47
47
  selectedFormat?: "json" | "hl7" | "fhir";
48
48
  onDictationComplete: (message: string) => void;
49
+ onDictationStart?: () => void;
50
+ onProcessingStart?: () => void;
49
51
  className?: string;
50
52
  style?: React$1.CSSProperties;
51
53
  buttonText?: string;
package/dist/index.js CHANGED
@@ -4604,9 +4604,9 @@ var AudioRecorder = ({
4604
4604
  var AudioRecorder_default = AudioRecorder;
4605
4605
  var API_BASE_URL2 = "https://nuxera.cloud";
4606
4606
  var useAudioDictation = ({
4607
- setIsProcessing,
4608
- setIsDictating,
4609
4607
  onDictationComplete,
4608
+ onDictationStart,
4609
+ onProcessingStart,
4610
4610
  apiKey,
4611
4611
  apiBaseUrl = API_BASE_URL2,
4612
4612
  appendMode = true,
@@ -4618,6 +4618,8 @@ var useAudioDictation = ({
4618
4618
  selectedFormat = "json"
4619
4619
  }) => {
4620
4620
  const [dictationError, setDictationError] = React3.useState(null);
4621
+ const [isDictating, setIsDictating] = React3.useState(false);
4622
+ const [isProcessing, setIsProcessing] = React3.useState(false);
4621
4623
  const audioContextRef = React3.useRef(null);
4622
4624
  const processorRef = React3.useRef(null);
4623
4625
  const mediaStreamRef = React3.useRef(null);
@@ -4702,6 +4704,7 @@ var useAudioDictation = ({
4702
4704
  audioContextRef.current = audioContext;
4703
4705
  processorRef.current = processor;
4704
4706
  setIsDictating(true);
4707
+ onDictationStart?.();
4705
4708
  console.log("Recording started successfully");
4706
4709
  } catch (error) {
4707
4710
  console.error("Error starting dictation:", error);
@@ -4819,6 +4822,7 @@ var useAudioDictation = ({
4819
4822
  console.log(`Processing dictation with audio data length: ${audioData.length}`);
4820
4823
  console.log(`Using format: ${selectedFormat}`);
4821
4824
  setIsProcessing(true);
4825
+ onProcessingStart?.();
4822
4826
  const wavBlob = encodeWAV(audioData);
4823
4827
  console.log(`Sending audio to dictation API (${wavBlob.size / 1024} KB)`);
4824
4828
  const requestData = {
@@ -4901,7 +4905,7 @@ var useAudioDictation = ({
4901
4905
  setIsDictating(false);
4902
4906
  }
4903
4907
  };
4904
- return { startDictating, stopDictating, dictationError };
4908
+ return { startDictating, stopDictating, dictationError, isDictating, isProcessing };
4905
4909
  };
4906
4910
  var useAudioDictation_default = useAudioDictation;
4907
4911
  var dictationStyles = `
@@ -4982,20 +4986,20 @@ var AudioDictation = ({
4982
4986
  specialty = "general",
4983
4987
  selectedFormat = "json",
4984
4988
  onDictationComplete,
4989
+ onDictationStart,
4990
+ onProcessingStart,
4985
4991
  className = "",
4986
4992
  style,
4987
4993
  buttonText,
4988
4994
  placeholder = "Click to dictate..."
4989
4995
  }) => {
4990
- const [isDictating, setIsDictating] = React3__namespace.useState(false);
4991
- const [isProcessing, setIsProcessing] = React3__namespace.useState(false);
4992
4996
  React3__namespace.useEffect(() => {
4993
4997
  injectDictationStyles();
4994
4998
  }, []);
4995
- const { startDictating, stopDictating, dictationError } = useAudioDictation_default({
4996
- setIsProcessing,
4997
- setIsDictating,
4999
+ const { startDictating, stopDictating, dictationError, isDictating, isProcessing } = useAudioDictation_default({
4998
5000
  onDictationComplete,
5001
+ onDictationStart,
5002
+ onProcessingStart,
4999
5003
  apiKey,
5000
5004
  apiBaseUrl,
5001
5005
  appendMode,