@usecrow/ui 0.1.56 → 0.1.58
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.cjs +394 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -36
- package/dist/index.d.ts +21 -36
- package/dist/index.js +394 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -389,8 +389,13 @@ interface CrowWidgetProps {
|
|
|
389
389
|
* responds in that language and the welcome message is translated.
|
|
390
390
|
*/
|
|
391
391
|
language?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Custom CSS to inject into the widget's Shadow DOM.
|
|
394
|
+
* Appended after default styles, allowing overrides.
|
|
395
|
+
*/
|
|
396
|
+
customCss?: string;
|
|
392
397
|
}
|
|
393
|
-
declare function CrowWidget({ productId, apiUrl, subdomain, variant, styles: propStyles, previewMode, showThinking: showThinkingProp, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, onReady, onIdentify, tools, navigate, onToolResult, getIdentityToken, context, toolRenderers, language, }: CrowWidgetProps): react_jsx_runtime.JSX.Element;
|
|
398
|
+
declare function CrowWidget({ productId, apiUrl, subdomain, variant, styles: propStyles, previewMode, showThinking: showThinkingProp, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, onReady, onIdentify, tools, navigate, onToolResult, getIdentityToken, context, toolRenderers, language, customCss, }: CrowWidgetProps): react_jsx_runtime.JSX.Element;
|
|
394
399
|
|
|
395
400
|
interface CrowCopilotProps {
|
|
396
401
|
/** Product ID for this copilot */
|
|
@@ -756,50 +761,26 @@ declare function useCrowAPI({ onIdentified, onReset }?: UseCrowAPIOptions): {
|
|
|
756
761
|
};
|
|
757
762
|
|
|
758
763
|
/**
|
|
759
|
-
* useVoiceInput -
|
|
764
|
+
* useVoiceInput - Speech-to-text via Gradium STT WebSocket
|
|
760
765
|
*
|
|
761
|
-
*
|
|
762
|
-
*
|
|
766
|
+
* Uses MediaRecorder API (works on all browsers including mobile Safari)
|
|
767
|
+
* and streams audio to backend WebSocket proxy for Gradium STT.
|
|
763
768
|
*/
|
|
764
|
-
interface SpeechRecognitionEvent {
|
|
765
|
-
results: SpeechRecognitionResultList;
|
|
766
|
-
resultIndex: number;
|
|
767
|
-
}
|
|
768
|
-
interface SpeechRecognitionErrorEvent {
|
|
769
|
-
error: string;
|
|
770
|
-
message?: string;
|
|
771
|
-
}
|
|
772
|
-
interface SpeechRecognitionInstance extends EventTarget {
|
|
773
|
-
continuous: boolean;
|
|
774
|
-
interimResults: boolean;
|
|
775
|
-
lang: string;
|
|
776
|
-
start(): void;
|
|
777
|
-
stop(): void;
|
|
778
|
-
abort(): void;
|
|
779
|
-
onresult: ((event: SpeechRecognitionEvent) => void) | null;
|
|
780
|
-
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
|
|
781
|
-
onend: (() => void) | null;
|
|
782
|
-
onspeechend: (() => void) | null;
|
|
783
|
-
}
|
|
784
|
-
declare global {
|
|
785
|
-
interface Window {
|
|
786
|
-
SpeechRecognition?: new () => SpeechRecognitionInstance;
|
|
787
|
-
webkitSpeechRecognition?: new () => SpeechRecognitionInstance;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
769
|
interface UseVoiceInputOptions {
|
|
791
|
-
/**
|
|
792
|
-
|
|
793
|
-
/** Auto-submit after silence. If set,
|
|
770
|
+
/** Backend URL for WebSocket connection (e.g., "ws://localhost:8000" or "wss://api.example.com") */
|
|
771
|
+
backendUrl: string;
|
|
772
|
+
/** Auto-submit after silence. If set, stops recording after this many ms of silence. */
|
|
794
773
|
silenceTimeoutMs?: number;
|
|
795
774
|
}
|
|
796
775
|
interface UseVoiceInputReturn {
|
|
797
|
-
/** Whether the browser supports
|
|
776
|
+
/** Whether the browser supports audio recording (MediaRecorder API) */
|
|
798
777
|
supported: boolean;
|
|
799
778
|
/** Whether currently recording */
|
|
800
779
|
isRecording: boolean;
|
|
801
|
-
/** Current transcript (
|
|
780
|
+
/** Current transcript (accumulated final results) */
|
|
802
781
|
transcript: string;
|
|
782
|
+
/** Error message if any */
|
|
783
|
+
error: string | null;
|
|
803
784
|
/** Start recording */
|
|
804
785
|
start: () => void;
|
|
805
786
|
/** Stop recording and finalize transcript */
|
|
@@ -809,7 +790,7 @@ interface UseVoiceInputReturn {
|
|
|
809
790
|
/** Clear the transcript */
|
|
810
791
|
clear: () => void;
|
|
811
792
|
}
|
|
812
|
-
declare function useVoiceInput(options
|
|
793
|
+
declare function useVoiceInput(options: UseVoiceInputOptions): UseVoiceInputReturn;
|
|
813
794
|
|
|
814
795
|
/**
|
|
815
796
|
* useWidgetStyles Hook
|
|
@@ -1139,6 +1120,10 @@ interface PromptInputBoxProps {
|
|
|
1139
1120
|
availableModels?: Model[];
|
|
1140
1121
|
/** When true, adds a pulsing highlight effect to indicate user input is needed */
|
|
1141
1122
|
highlighted?: boolean;
|
|
1123
|
+
/** Backend URL for voice input WebSocket (required for voice input to work) */
|
|
1124
|
+
backendUrl?: string;
|
|
1125
|
+
/** When this value changes (and is > 0), start voice recording */
|
|
1126
|
+
triggerVoiceRecording?: number;
|
|
1142
1127
|
}
|
|
1143
1128
|
declare const PromptInputBox: react__default.ForwardRefExoticComponent<PromptInputBoxProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
1144
1129
|
|
package/dist/index.d.ts
CHANGED
|
@@ -389,8 +389,13 @@ interface CrowWidgetProps {
|
|
|
389
389
|
* responds in that language and the welcome message is translated.
|
|
390
390
|
*/
|
|
391
391
|
language?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Custom CSS to inject into the widget's Shadow DOM.
|
|
394
|
+
* Appended after default styles, allowing overrides.
|
|
395
|
+
*/
|
|
396
|
+
customCss?: string;
|
|
392
397
|
}
|
|
393
|
-
declare function CrowWidget({ productId, apiUrl, subdomain, variant, styles: propStyles, previewMode, showThinking: showThinkingProp, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, onReady, onIdentify, tools, navigate, onToolResult, getIdentityToken, context, toolRenderers, language, }: CrowWidgetProps): react_jsx_runtime.JSX.Element;
|
|
398
|
+
declare function CrowWidget({ productId, apiUrl, subdomain, variant, styles: propStyles, previewMode, showThinking: showThinkingProp, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, onReady, onIdentify, tools, navigate, onToolResult, getIdentityToken, context, toolRenderers, language, customCss, }: CrowWidgetProps): react_jsx_runtime.JSX.Element;
|
|
394
399
|
|
|
395
400
|
interface CrowCopilotProps {
|
|
396
401
|
/** Product ID for this copilot */
|
|
@@ -756,50 +761,26 @@ declare function useCrowAPI({ onIdentified, onReset }?: UseCrowAPIOptions): {
|
|
|
756
761
|
};
|
|
757
762
|
|
|
758
763
|
/**
|
|
759
|
-
* useVoiceInput -
|
|
764
|
+
* useVoiceInput - Speech-to-text via Gradium STT WebSocket
|
|
760
765
|
*
|
|
761
|
-
*
|
|
762
|
-
*
|
|
766
|
+
* Uses MediaRecorder API (works on all browsers including mobile Safari)
|
|
767
|
+
* and streams audio to backend WebSocket proxy for Gradium STT.
|
|
763
768
|
*/
|
|
764
|
-
interface SpeechRecognitionEvent {
|
|
765
|
-
results: SpeechRecognitionResultList;
|
|
766
|
-
resultIndex: number;
|
|
767
|
-
}
|
|
768
|
-
interface SpeechRecognitionErrorEvent {
|
|
769
|
-
error: string;
|
|
770
|
-
message?: string;
|
|
771
|
-
}
|
|
772
|
-
interface SpeechRecognitionInstance extends EventTarget {
|
|
773
|
-
continuous: boolean;
|
|
774
|
-
interimResults: boolean;
|
|
775
|
-
lang: string;
|
|
776
|
-
start(): void;
|
|
777
|
-
stop(): void;
|
|
778
|
-
abort(): void;
|
|
779
|
-
onresult: ((event: SpeechRecognitionEvent) => void) | null;
|
|
780
|
-
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
|
|
781
|
-
onend: (() => void) | null;
|
|
782
|
-
onspeechend: (() => void) | null;
|
|
783
|
-
}
|
|
784
|
-
declare global {
|
|
785
|
-
interface Window {
|
|
786
|
-
SpeechRecognition?: new () => SpeechRecognitionInstance;
|
|
787
|
-
webkitSpeechRecognition?: new () => SpeechRecognitionInstance;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
769
|
interface UseVoiceInputOptions {
|
|
791
|
-
/**
|
|
792
|
-
|
|
793
|
-
/** Auto-submit after silence. If set,
|
|
770
|
+
/** Backend URL for WebSocket connection (e.g., "ws://localhost:8000" or "wss://api.example.com") */
|
|
771
|
+
backendUrl: string;
|
|
772
|
+
/** Auto-submit after silence. If set, stops recording after this many ms of silence. */
|
|
794
773
|
silenceTimeoutMs?: number;
|
|
795
774
|
}
|
|
796
775
|
interface UseVoiceInputReturn {
|
|
797
|
-
/** Whether the browser supports
|
|
776
|
+
/** Whether the browser supports audio recording (MediaRecorder API) */
|
|
798
777
|
supported: boolean;
|
|
799
778
|
/** Whether currently recording */
|
|
800
779
|
isRecording: boolean;
|
|
801
|
-
/** Current transcript (
|
|
780
|
+
/** Current transcript (accumulated final results) */
|
|
802
781
|
transcript: string;
|
|
782
|
+
/** Error message if any */
|
|
783
|
+
error: string | null;
|
|
803
784
|
/** Start recording */
|
|
804
785
|
start: () => void;
|
|
805
786
|
/** Stop recording and finalize transcript */
|
|
@@ -809,7 +790,7 @@ interface UseVoiceInputReturn {
|
|
|
809
790
|
/** Clear the transcript */
|
|
810
791
|
clear: () => void;
|
|
811
792
|
}
|
|
812
|
-
declare function useVoiceInput(options
|
|
793
|
+
declare function useVoiceInput(options: UseVoiceInputOptions): UseVoiceInputReturn;
|
|
813
794
|
|
|
814
795
|
/**
|
|
815
796
|
* useWidgetStyles Hook
|
|
@@ -1139,6 +1120,10 @@ interface PromptInputBoxProps {
|
|
|
1139
1120
|
availableModels?: Model[];
|
|
1140
1121
|
/** When true, adds a pulsing highlight effect to indicate user input is needed */
|
|
1141
1122
|
highlighted?: boolean;
|
|
1123
|
+
/** Backend URL for voice input WebSocket (required for voice input to work) */
|
|
1124
|
+
backendUrl?: string;
|
|
1125
|
+
/** When this value changes (and is > 0), start voice recording */
|
|
1126
|
+
triggerVoiceRecording?: number;
|
|
1142
1127
|
}
|
|
1143
1128
|
declare const PromptInputBox: react__default.ForwardRefExoticComponent<PromptInputBoxProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
1144
1129
|
|