interview-widget 3.3.2 → 3.3.3-beta.0

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.
Files changed (63) hide show
  1. package/README.md +15 -7
  2. package/dist/StreamingAudioPlayer-DmOtqI_a-BX7ptCkK.js +430 -0
  3. package/dist/_headers +2 -0
  4. package/dist/assets/avatar_core_wasm-36bf5449.wasm +0 -0
  5. package/dist/assets/avatar_core_wasm.js +2697 -0
  6. package/dist/assets/index.d.ts +0 -11
  7. package/dist/assets/style-8JJ3h3Ol.css +1 -0
  8. package/dist/avatar_core_wasm-BIbE25D3-D94zNSYX.js +1651 -0
  9. package/dist/components/interview/interview-content.d.ts +8 -0
  10. package/dist/components/interview/interview-controller.d.ts +8 -1
  11. package/dist/components/interview/interview-header.d.ts +1 -1
  12. package/dist/components/interview/proctoring/gaze-detection/utils/types.d.ts +1 -10
  13. package/dist/components/interview/proctoring/interview-proctoring.d.ts +1 -0
  14. package/dist/components/interview/question-text.d.ts +4 -0
  15. package/dist/components/interview/transcript/interview-transcript.d.ts +1 -0
  16. package/dist/components/media/spatius-avatar-feed.d.ts +11 -0
  17. package/dist/components/media/video-feed.d.ts +4 -0
  18. package/dist/components/modals/onboarding-modal.d.ts +4 -1
  19. package/dist/components/ui/extended/chat-ui.d.ts +1 -4
  20. package/dist/context/interview-widget-context.d.ts +0 -8
  21. package/dist/context/proctoring-context.d.ts +1 -22
  22. package/dist/hooks/index.d.ts +2 -1
  23. package/dist/hooks/use-network-quality.d.ts +2 -1
  24. package/dist/hooks/use-next-question-stream.d.ts +11 -0
  25. package/dist/hooks/use-question-stream.d.ts +20 -0
  26. package/dist/hooks/use-spatius-question-stream.d.ts +22 -0
  27. package/dist/hooks/use-timer.d.ts +3 -2
  28. package/dist/hooks/use-tts.d.ts +1 -1
  29. package/dist/index-DXUDYyS8.js +17107 -0
  30. package/dist/services/api/endpoints.d.ts +2 -4
  31. package/dist/services/timer/index.d.ts +0 -1
  32. package/dist/services/tts/tts-service.d.ts +3 -2
  33. package/dist/types.d.ts +4 -0
  34. package/dist/utils/constants.d.ts +0 -5
  35. package/dist/utils/crypto.d.ts +0 -7
  36. package/dist/utils/helper.d.ts +0 -4
  37. package/dist/widget.es.3.3.3-beta.0.js +10532 -0
  38. package/dist/widget.umd.3.3.3-beta.0.js +783 -0
  39. package/package.json +10 -11
  40. package/dist/assets/clock-icon.d.ts +0 -1
  41. package/dist/assets/focus-icon.d.ts +0 -1
  42. package/dist/assets/info-icon.d.ts +0 -1
  43. package/dist/assets/keyboard-icon.d.ts +0 -1
  44. package/dist/assets/mic-off-icon.d.ts +0 -1
  45. package/dist/assets/monitor-icon.d.ts +0 -1
  46. package/dist/assets/mouse-pointer-click-icon.d.ts +0 -1
  47. package/dist/assets/scan-face-icon.d.ts +0 -1
  48. package/dist/assets/shield-icon.d.ts +0 -2
  49. package/dist/assets/speak-icon.d.ts +0 -1
  50. package/dist/assets/video-off-icon.d.ts +0 -1
  51. package/dist/assets/volumn-icon.d.ts +0 -1
  52. package/dist/components/interview/answer-area.d.ts +0 -12
  53. package/dist/components/interview/phases/interview-completion-modal.d.ts +0 -7
  54. package/dist/components/interview/proctoring/face-data-permission-modal.d.ts +0 -7
  55. package/dist/components/ui/dialog.d.ts +0 -13
  56. package/dist/components/ui/input.d.ts +0 -8
  57. package/dist/components/ui/media-control-item.d.ts +0 -8
  58. package/dist/hooks/use-dialog.d.ts +0 -6
  59. package/dist/styles.d.ts +0 -0
  60. package/dist/utils/audio-storage.d.ts +0 -24
  61. package/dist/widget.3.3.2.css +0 -1
  62. package/dist/widget.es.3.3.2.js +0 -9795
  63. package/dist/widget.umd.3.3.2.js +0 -179
@@ -27,6 +27,14 @@ interface InterviewContentProps {
27
27
  retryClicksCount?: number;
28
28
  isFetchingQuestion?: boolean;
29
29
  onExitInterview?: () => void;
30
+ isAvatarEnabled?: boolean;
31
+ avatarCanvasRef?: React.RefObject<HTMLDivElement | null>;
32
+ isReceivingAvatar?: boolean;
33
+ isAvatarReady?: boolean;
34
+ isStartingAvatar?: boolean;
35
+ isAvatarSpeaking?: boolean;
36
+ avatarLoadProgress?: number;
37
+ isInterviewStarted?: boolean;
30
38
  }
31
39
  export declare const InterviewContent: React.FC<InterviewContentProps>;
32
40
  export {};
@@ -9,6 +9,13 @@ interface InterviewControllerProps {
9
9
  onDisqualify?: (() => void) | undefined;
10
10
  className?: string;
11
11
  videoFeedRef?: React.Ref<VideoFeedHandle>;
12
+ onStartReadyChange?: (isReady: boolean) => void;
13
+ onStartErrorChange?: (error: string | null) => void;
14
+ isInterviewStarted?: boolean;
12
15
  }
13
- declare const InterviewController: React.FC<InterviewControllerProps>;
16
+ export interface InterviewControllerHandle {
17
+ startInterview: () => Promise<void>;
18
+ retryAvatarPreparation: () => void;
19
+ }
20
+ declare const InterviewController: React.ForwardRefExoticComponent<InterviewControllerProps & React.RefAttributes<InterviewControllerHandle>>;
14
21
  export default InterviewController;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- export interface InterviewHeaderProps {
2
+ interface InterviewHeaderProps {
3
3
  title: string;
4
4
  brandName?: string;
5
5
  brandLogo?: React.ReactNode;
@@ -24,22 +24,13 @@ export interface Stats {
24
24
  multipleFacesDetected: boolean;
25
25
  referenceFaceNotDetected: boolean;
26
26
  }
27
- export type GazeViolationType = 'looking_away' | 'no_face_detected' | 'multiple_faces';
27
+ export type GazeViolationType = "looking_away" | "no_face_detected" | "multiple_faces";
28
28
  export interface GazeViolationCounters {
29
29
  lookingAwayCount: number;
30
30
  noFaceDetectedCount: number;
31
31
  multipleFacesCount: number;
32
32
  totalGazeViolations: number;
33
33
  }
34
- export interface GazeAnalysisState {
35
- referenceSet: boolean;
36
- referenceRef: {
37
- x: number;
38
- y: number;
39
- noseX: number;
40
- noseY: number;
41
- };
42
- }
43
34
  export interface GazeWarningConfig {
44
35
  icon: React.ComponentType<{
45
36
  className?: string;
@@ -14,6 +14,7 @@ interface Props {
14
14
  onDisqualify?: (() => void) | undefined;
15
15
  onExit?: (() => void) | undefined;
16
16
  isCompleted?: boolean;
17
+ isActive?: boolean;
17
18
  }
18
19
  export interface InterviewProctoringHandle {
19
20
  exitFullScreenIntentionally: () => Promise<void>;
@@ -0,0 +1,4 @@
1
+ export declare const QuestionLoadingText: React.FC;
2
+ export declare const AnimatedQuestionText: React.FC<{
3
+ text: string;
4
+ }>;
@@ -14,6 +14,7 @@ interface InterviewTranscriptProps {
14
14
  onAnswerChange?: ((e: React.ChangeEvent<HTMLTextAreaElement>) => void) | undefined;
15
15
  timerState?: TimerState | undefined;
16
16
  editingTime?: number | undefined;
17
+ isActive?: boolean;
17
18
  }
18
19
  export declare const InterviewTranscript: React.FC<InterviewTranscriptProps>;
19
20
  export {};
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ interface SpatiusAvatarFeedProps {
3
+ canvasRef: RefObject<HTMLDivElement | null>;
4
+ isReceivingAvatar: boolean;
5
+ isReady: boolean;
6
+ isStarting: boolean;
7
+ isSpeaking: boolean;
8
+ loadProgress: number;
9
+ }
10
+ export declare function SpatiusAvatarFeed({ canvasRef, isReceivingAvatar, isReady, isStarting, isSpeaking, loadProgress, }: SpatiusAvatarFeedProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { GazeWarningTypeValue } from '../interview/proctoring/gaze-detection/config/gaze-modal-config';
2
3
  export interface VideoFeedHandle {
3
4
  setReference: () => void;
@@ -16,6 +17,9 @@ interface VideoFeedProps {
16
17
  onProctoringStatusChange?: (status: GazeWarningTypeValue) => void;
17
18
  showStatusOverlay?: boolean;
18
19
  cheatingWarningVisible?: boolean;
20
+ isListening?: boolean;
21
+ actionOverlay?: ReactNode;
22
+ animateAnswerStart?: boolean;
19
23
  isDeviceLoading?: boolean;
20
24
  videoAllowed?: boolean;
21
25
  questionNumber?: number;
@@ -2,7 +2,10 @@ import { default as React } from 'react';
2
2
  import { VideoFeedHandle } from '../media/video-feed';
3
3
  interface PermissionModalProps {
4
4
  isOpen: boolean;
5
- onStart: () => void;
5
+ onStart: () => Promise<void> | void;
6
+ isStartReady?: boolean;
7
+ preparationError?: string | null;
8
+ onRetryPreparation?: () => void;
6
9
  onRequestCalibration?: () => void;
7
10
  onClose?: () => void;
8
11
  gazeEnabled?: boolean;
@@ -1,10 +1,7 @@
1
1
  export declare const SystemMessage: React.FC<{
2
2
  children: React.ReactNode;
3
3
  }>;
4
- export declare const UserMessage: React.FC<{
5
- children: React.ReactNode;
6
- }>;
7
- export declare const QuestionLabel: ({ questionNumber }: {
4
+ export declare const QuestionLabel: ({ questionNumber, }: {
8
5
  questionNumber: number;
9
6
  }) => import("react/jsx-runtime").JSX.Element;
10
7
  export declare const TypingDots: ({ label }: {
@@ -26,12 +26,4 @@ export declare function useUIConfig(): {
26
26
  retryNoAttemptsLeftText?: string;
27
27
  };
28
28
  export declare function useInterviewConfigSection(): NonNullable<InterviewWidgetConfig["interview"]>;
29
- export declare function useSTTConfig(): {
30
- provider?: "groq" | "deepgram";
31
- model?: "whisper-large-v3-turbo" | (string & {});
32
- language?: "en";
33
- } | undefined;
34
- export declare function useTTSConfig(): {
35
- provider?: "piper";
36
- } | undefined;
37
29
  export {};
@@ -1,21 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { ViolationLogger } from '../types';
3
3
  import { GazeViolationCounters, GazeViolationType } from '../components/interview/proctoring/gaze-detection/utils/types';
4
- export type ProctoringState = {
5
- logViolations: ViolationLogger[];
6
- totalViolations: number;
7
- gazeViolationCounters: GazeViolationCounters;
8
- referenceSet: boolean;
9
- referenceRef: {
10
- x: number;
11
- y: number;
12
- noseX: number;
13
- noseY: number;
14
- };
15
- };
16
4
  export declare const ProctoringProvider: React.FC<{
17
5
  children: React.ReactNode;
18
6
  interviewId?: string;
7
+ enabled?: boolean;
19
8
  }>;
20
9
  export declare const useProctoringStore: () => {
21
10
  logViolations: ViolationLogger[];
@@ -41,16 +30,6 @@ export declare const useProctoringStore: () => {
41
30
  };
42
31
  export declare const useViolations: () => ViolationLogger[];
43
32
  export declare const useTotalViolations: () => number;
44
- export declare const useGazeViolationCounters: () => GazeViolationCounters;
45
- export declare const useReferenceData: () => {
46
- referenceSet: boolean;
47
- referenceRef: {
48
- x: number;
49
- y: number;
50
- noseX: number;
51
- noseY: number;
52
- };
53
- };
54
33
  export declare const useProctoringActions: () => {
55
34
  addViolation: (violation: ViolationLogger) => void;
56
35
  clearViolations: () => void;
@@ -1,9 +1,10 @@
1
1
  export * from './use-api';
2
- export * from './use-dialog';
3
2
  export * from './use-full-screen';
4
3
  export * from './use-interview-api';
5
4
  export * from './use-keyboard-prevention';
6
5
  export * from './use-network-quality';
6
+ export * from './use-next-question-stream';
7
+ export * from './use-question-stream';
7
8
  export * from './use-stt';
8
9
  export * from './use-tab-switch';
9
10
  export * from './use-text-selection-prevention';
@@ -1,4 +1,4 @@
1
- export type NetworkQualityLevel = "good" | "fair" | "poor" | "disconnected";
1
+ type NetworkQualityLevel = "good" | "fair" | "poor" | "disconnected";
2
2
  export interface NetworkQualityState {
3
3
  quality: NetworkQualityLevel;
4
4
  isOnline: boolean;
@@ -8,3 +8,4 @@ export interface NetworkQualityState {
8
8
  isInitialising: boolean;
9
9
  }
10
10
  export declare function useNetworkQuality(): NetworkQualityState;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { APIError, InterviewQuestionData, InterviewQuestionResponse } from '../types';
2
+ type StreamOptions = {
3
+ onQuestionChange?: (question: InterviewQuestionData) => void;
4
+ };
5
+ export declare function useNextQuestionStream(): {
6
+ streamNextQuestion: (interviewId: string, options?: StreamOptions) => Promise<InterviewQuestionResponse>;
7
+ loading: boolean;
8
+ error: APIError | null;
9
+ cancel: () => void;
10
+ };
11
+ export {};
@@ -0,0 +1,20 @@
1
+ export declare function useQuestionStream(interviewId: string): {
2
+ streamNextQuestion: (interviewId: string, options?: {
3
+ onQuestionChange?: (question: import('..').InterviewQuestionData) => void;
4
+ }) => Promise<import('..').InterviewQuestionResponse>;
5
+ loading: boolean;
6
+ error: import('..').APIError | null;
7
+ cancel: () => void;
8
+ isAvatarEnabled: boolean;
9
+ avatarCanvasRef: import('react').RefObject<HTMLDivElement | null>;
10
+ isReceivingAvatar: boolean;
11
+ isAvatarReady: boolean;
12
+ isStartingAvatar: boolean;
13
+ isAvatarSpeaking: boolean;
14
+ avatarLoadProgress: number;
15
+ openAvatarSession: () => Promise<void>;
16
+ startAvatar: () => Promise<void>;
17
+ startAvatarListening: () => void;
18
+ stopAvatarListening: () => void;
19
+ disconnectAvatar: () => void;
20
+ };
@@ -0,0 +1,22 @@
1
+ import { APIError, InterviewQuestionData, InterviewQuestionResponse } from '../types';
2
+ type StreamOptions = {
3
+ onQuestionChange?: (question: InterviewQuestionData) => void;
4
+ };
5
+ export declare function useSpatiusQuestionStream(interviewId: string, enabled: boolean): {
6
+ streamNextQuestion: (requestedInterviewId: string, options?: StreamOptions) => Promise<InterviewQuestionResponse>;
7
+ loading: boolean;
8
+ error: APIError | null;
9
+ cancel: () => void;
10
+ canvasRef: import('react').RefObject<HTMLDivElement | null>;
11
+ isReceivingAvatar: boolean;
12
+ isAvatarReady: boolean;
13
+ isStartingAvatar: boolean;
14
+ isAvatarSpeaking: boolean;
15
+ loadProgress: number;
16
+ openAvatarSession: () => Promise<void>;
17
+ startAvatar: () => Promise<void>;
18
+ startListening: () => void;
19
+ stopListening: () => void;
20
+ disconnect: () => void;
21
+ };
22
+ export {};
@@ -1,9 +1,9 @@
1
1
  import { TimerCallbacks, TimerConfig, TimerService, TimerState } from '../services/timer/timer-service';
2
- export interface UseTimerOptions {
2
+ interface UseTimerOptions {
3
3
  config?: Partial<TimerConfig>;
4
4
  callbacks?: TimerCallbacks;
5
5
  }
6
- export interface UseTimerReturn {
6
+ interface UseTimerReturn {
7
7
  state: TimerState;
8
8
  startQuestion: () => void;
9
9
  nextPhase: () => void;
@@ -11,3 +11,4 @@ export interface UseTimerReturn {
11
11
  timerService: TimerService;
12
12
  }
13
13
  export declare function useTimer(options?: UseTimerOptions): UseTimerReturn;
14
+ export {};
@@ -1,5 +1,5 @@
1
1
  export interface UseTTSReturn {
2
- speak: (audioData: string) => Promise<void>;
2
+ speak: (audioData: string | string[]) => Promise<void>;
3
3
  stop: () => void;
4
4
  isPlaying: boolean;
5
5
  isLoading: boolean;