interview-widget 3.3.1 → 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 (74) hide show
  1. package/README.md +15 -4
  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 +5 -12
  7. package/dist/assets/net-cross-icon.d.ts +1 -0
  8. package/dist/assets/style-8JJ3h3Ol.css +1 -0
  9. package/dist/assets/wifi-icon.d.ts +1 -0
  10. package/dist/assets/wifi-low-icon.d.ts +1 -0
  11. package/dist/assets/wifi-off-icon.d.ts +1 -0
  12. package/dist/avatar_core_wasm-BIbE25D3-D94zNSYX.js +1651 -0
  13. package/dist/components/interview/interview-content.d.ts +13 -0
  14. package/dist/components/interview/interview-controller.d.ts +8 -1
  15. package/dist/components/interview/interview-header.d.ts +1 -1
  16. package/dist/components/interview/proctoring/gaze-detection/utils/types.d.ts +1 -10
  17. package/dist/components/interview/proctoring/interview-proctoring.d.ts +1 -0
  18. package/dist/components/interview/question-text.d.ts +4 -0
  19. package/dist/components/interview/transcript/interview-transcript.d.ts +1 -0
  20. package/dist/components/media/spatius-avatar-feed.d.ts +11 -0
  21. package/dist/components/media/video-feed.d.ts +5 -0
  22. package/dist/components/modals/onboarding-modal.d.ts +4 -1
  23. package/dist/components/modals/retry-confirmation-modal.d.ts +9 -0
  24. package/dist/components/network/network-quality-bar.d.ts +6 -0
  25. package/dist/components/network/network-quality-config.d.ts +21 -0
  26. package/dist/components/network/network-warning-modal.d.ts +12 -0
  27. package/dist/components/ui/extended/chat-ui.d.ts +1 -4
  28. package/dist/context/interview-widget-context.d.ts +3 -8
  29. package/dist/context/proctoring-context.d.ts +1 -22
  30. package/dist/hooks/index.d.ts +3 -1
  31. package/dist/hooks/use-network-quality.d.ts +11 -0
  32. package/dist/hooks/use-next-question-stream.d.ts +11 -0
  33. package/dist/hooks/use-question-stream.d.ts +20 -0
  34. package/dist/hooks/use-spatius-question-stream.d.ts +22 -0
  35. package/dist/hooks/use-timer.d.ts +3 -2
  36. package/dist/hooks/use-tts.d.ts +1 -1
  37. package/dist/hooks/use-video-recording.d.ts +1 -1
  38. package/dist/index-DXUDYyS8.js +17107 -0
  39. package/dist/services/api/endpoints.d.ts +2 -4
  40. package/dist/services/stt/stt-service.d.ts +1 -0
  41. package/dist/services/timer/index.d.ts +0 -1
  42. package/dist/services/tts/tts-service.d.ts +3 -2
  43. package/dist/types.d.ts +7 -0
  44. package/dist/utils/constants.d.ts +0 -5
  45. package/dist/utils/crypto.d.ts +0 -7
  46. package/dist/utils/helper.d.ts +0 -4
  47. package/dist/utils/safari-audio-utils.d.ts +49 -0
  48. package/dist/widget.es.3.3.3-beta.0.js +10532 -0
  49. package/dist/widget.umd.3.3.3-beta.0.js +783 -0
  50. package/package.json +10 -11
  51. package/dist/assets/clock-icon.d.ts +0 -1
  52. package/dist/assets/focus-icon.d.ts +0 -1
  53. package/dist/assets/info-icon.d.ts +0 -1
  54. package/dist/assets/keyboard-icon.d.ts +0 -1
  55. package/dist/assets/mic-off-icon.d.ts +0 -1
  56. package/dist/assets/monitor-icon.d.ts +0 -1
  57. package/dist/assets/mouse-pointer-click-icon.d.ts +0 -1
  58. package/dist/assets/scan-face-icon.d.ts +0 -1
  59. package/dist/assets/shield-icon.d.ts +0 -2
  60. package/dist/assets/speak-icon.d.ts +0 -1
  61. package/dist/assets/video-off-icon.d.ts +0 -1
  62. package/dist/assets/volumn-icon.d.ts +0 -1
  63. package/dist/components/interview/answer-area.d.ts +0 -12
  64. package/dist/components/interview/phases/interview-completion-modal.d.ts +0 -7
  65. package/dist/components/interview/proctoring/face-data-permission-modal.d.ts +0 -7
  66. package/dist/components/ui/dialog.d.ts +0 -13
  67. package/dist/components/ui/input.d.ts +0 -8
  68. package/dist/components/ui/media-control-item.d.ts +0 -8
  69. package/dist/hooks/use-dialog.d.ts +0 -6
  70. package/dist/styles.d.ts +0 -0
  71. package/dist/utils/audio-storage.d.ts +0 -24
  72. package/dist/widget.3.3.1.css +0 -1
  73. package/dist/widget.es.3.3.1.js +0 -9366
  74. package/dist/widget.umd.3.3.1.js +0 -179
@@ -1,13 +1,11 @@
1
- export declare const API_VERSIONS: {
2
- v1: string;
3
- v2: string;
4
- };
5
1
  export declare const API_ENDPOINTS_V1: {
6
2
  GENERATE_QUESTION: string;
7
3
  SCREENSHOT_UPLOAD: (interviewId: string) => string;
8
4
  };
9
5
  export declare const API_ENDPOINTS: {
10
6
  GENERATE_QUESTION: (interviewId: string) => string;
7
+ GENERATE_QUESTION_SSE: (interviewId: string) => string;
8
+ AVATAR_WS: (interviewId: string) => string;
11
9
  SCREENSHOT_UPLOAD: (interviewId: string) => string;
12
10
  CONFIRM_UPLOAD: (assetId: string) => string;
13
11
  TRANSCRIBE_ANSWER: (interviewId: string) => string;
@@ -44,6 +44,7 @@ declare class STTService {
44
44
  private pendingStopPromise;
45
45
  private isStarting;
46
46
  private recordingStartTime;
47
+ private lastRecordedBlob;
47
48
  static activeStream: MediaStream | null;
48
49
  constructor(config?: STTConfig);
49
50
  /**
@@ -1,6 +1,5 @@
1
1
  export { TimerPhase, TimerService } from './timer-service';
2
2
  export type { TimerCallbacks, TimerConfig, TimerState } from './timer-service';
3
3
  export { useTimer } from '../../hooks/use-timer';
4
- export type { UseTimerOptions, UseTimerReturn } from '../../hooks/use-timer';
5
4
  export { default as InterviewController } from '../../components/interview/interview-controller';
6
5
  export { default as TimerDisplay } from '../../components/timer/timer-display';
@@ -1,4 +1,4 @@
1
- export interface TTSPlaybackEvents {
1
+ interface TTSPlaybackEvents {
2
2
  onStart?: () => void;
3
3
  onEnd?: () => void;
4
4
  onError?: (error: Error) => void;
@@ -8,7 +8,8 @@ declare class TTSService {
8
8
  /**
9
9
  * Play base64 audio data
10
10
  */
11
- play(audioDataBase64: string, events?: TTSPlaybackEvents): Promise<void>;
11
+ play(audioDataBase64: string | string[], events?: TTSPlaybackEvents): Promise<void>;
12
+ private playChunk;
12
13
  /**
13
14
  * Stop current audio playback
14
15
  */
package/dist/types.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface InterviewQuestionData {
3
3
  qna_id: string;
4
4
  question: string;
5
5
  question_audio_data_base64: string | null;
6
+ question_audio_chunks_base64?: string[];
6
7
  audio_length_in_milliseconds: number;
7
8
  estimated_answer_duration_in_seconds: number;
8
9
  is_interview_done: boolean;
@@ -46,6 +47,9 @@ export interface InterviewWidgetConfig {
46
47
  ui?: {
47
48
  baseColor?: string;
48
49
  borderRadius?: string;
50
+ retryProgressSavedText?: string;
51
+ retryMaxAttempts?: number;
52
+ retryNoAttemptsLeftText?: string;
49
53
  };
50
54
  interview?: {
51
55
  allow_answer_editing?: boolean;
@@ -64,6 +68,9 @@ export interface InterviewWidgetConfig {
64
68
  tts?: {
65
69
  provider?: "piper";
66
70
  };
71
+ avatar?: {
72
+ provider?: "none" | "spatius";
73
+ };
67
74
  proctoring?: {
68
75
  enabled?: boolean;
69
76
  gazeAnalysisEnabled?: boolean;
@@ -1,11 +1,6 @@
1
1
  import { InterviewWidgetConfig } from '../types';
2
2
  export declare const defaultConfig: Required<InterviewWidgetConfig>;
3
3
  export declare const STORAGE_KEY = "iw-storage";
4
- /**
5
- * Get encryption seed from various sources depending on the environment
6
- * Works with: Vite React, Next.js, Vanilla JS
7
- */
8
- export declare function getEncryptionSeed(): string;
9
4
  export declare const ENCRYPTION_SEED: string;
10
5
  export declare const INTERVIEW_TOTAL_DURATION_MIN = 30;
11
6
  export declare const ASSET_TYPE: {
@@ -1,9 +1,2 @@
1
- /**
2
- * Encrypt data with AES-GCM
3
- * @param data - The data to encrypt (will be JSON stringified if not a string)
4
- * @param seed - A seed string to derive the encryption key (e.g., session ID, user ID)
5
- * @returns Base64 encoded encrypted data (IV + ciphertext + tag)
6
- */
7
- export declare function encrypt(data: unknown, seed?: string): Promise<string>;
8
1
  export declare function encryptForStorage(data: unknown, seed?: string): Promise<string>;
9
2
  export declare function decryptFromStorage<T = unknown>(encryptedData: string, seed?: string): Promise<T>;
@@ -1,7 +1,3 @@
1
- export declare function generateGradientStyles(baseColor: string, lightenAmount?: number): {
2
- background: string;
3
- color: string;
4
- };
5
1
  export declare function sleep(ms: number): Promise<void>;
6
2
  export declare function generateButtonGradient(baseColor: string): string;
7
3
  export declare const generateUniqueId: () => string;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Safari Audio Utilities
3
+ *
4
+ * Centralises all Safari-specific audio quirks so every call site stays clean.
5
+ * Each function is a transparent no-op / pass-through on non-Safari browsers.
6
+ *
7
+ * Safari-specific lines are tagged with // [SAFARI] for easy auditing.
8
+ */
9
+ /**
10
+ * Returns true only for genuine Safari (desktop + iOS).
11
+ * Chrome/Edge on iOS report as Safari in the UA, but they also advertise
12
+ * "Chrome" or "CriOS" / "EdgA" — we exclude those. [SAFARI]
13
+ */
14
+ export declare function isSafari(): boolean;
15
+ /**
16
+ * Returns the best supported MIME type for MediaRecorder.
17
+ *
18
+ * Safari only supports audio/mp4 (AAC-LC). Offering audio/webm first causes
19
+ * MediaRecorder construction to throw a NotSupportedError on Safari. [SAFARI]
20
+ */
21
+ export declare function getSupportedMimeType(): string;
22
+ /**
23
+ * Strips constraints that throw OverconstrainedError on Safari.
24
+ *
25
+ * Safari rejects `sampleRate` and `channelCount` as MediaTrackConstraints,
26
+ * raising an OverconstrainedError that blocks mic access entirely. [SAFARI]
27
+ * All other browsers receive the full constraint set unchanged.
28
+ */
29
+ export declare function getSafariSafeAudioConstraints(base?: MediaTrackConstraints): MediaTrackConstraints;
30
+ /**
31
+ * Returns the timeslice argument (ms) to pass to MediaRecorder.start().
32
+ *
33
+ * Safari silently suppresses `ondataavailable` events when a timeslice is
34
+ * provided — it will only emit one blob when stop() is called. [SAFARI]
35
+ * Returning `undefined` causes the caller to call `start()` with no argument,
36
+ * which is the correct Safari behaviour.
37
+ *
38
+ * Other browsers get 100 ms streaming chunks for real-time processing.
39
+ */
40
+ export declare function getMediaRecorderStartArg(): number | undefined;
41
+ /**
42
+ * [SAFARI] Do NOT call requestData() before stop().
43
+ * Without a timeslice, stop() guarantees one ondataavailable fires
44
+ * synchronously before onstop. Calling requestData() first queues a
45
+ * SECOND ondataavailable as a separate task — on some Safari versions
46
+ * that second event arrives AFTER onstop, so audioChunks is empty
47
+ * when the blob is assembled. Just call stop().
48
+ */
49
+ export declare function safariSafeStop(recorder: MediaRecorder): void;