@cuekit-ai/react 1.5.0 → 1.6.1

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
@@ -4,23 +4,27 @@ import * as livekit_client from 'livekit-client';
4
4
  import { ConnectionState, Room } from 'livekit-client';
5
5
 
6
6
  declare global {
7
- interface CueKitGlobalStore {
7
+ interface AnsyrGlobalStore {
8
8
  intent: string | null;
9
9
  lastText: string;
10
10
  lastClickedLabel: string;
11
11
  apiKey?: string;
12
12
  appId?: string;
13
13
  deviceId?: string;
14
- update: (data: Partial<CueKitGlobalStore>) => void;
14
+ update: (data: Partial<AnsyrGlobalStore>) => void;
15
15
  }
16
- var CuekitStore: CueKitGlobalStore;
16
+ var AnsyrStore: AnsyrGlobalStore;
17
17
  }
18
- type QubeCtx = {
18
+ type AnsyrCtx = {
19
19
  apiKey: string;
20
20
  appId: string;
21
+ title: string;
22
+ showLogo: boolean;
23
+ showAIIcon: boolean;
24
+ showUserIcon: boolean;
21
25
  };
22
- declare const useQubeContext: () => QubeCtx;
23
- type Props = {
26
+ declare const useAnsyrContext: () => AnsyrCtx;
27
+ interface Props {
24
28
  apiKey: string;
25
29
  deviceId?: string;
26
30
  appId: string;
@@ -29,8 +33,12 @@ type Props = {
29
33
  onConnectionStateChange?: (state: any) => void;
30
34
  onParticipantUpdate?: (participants: string[]) => void;
31
35
  onToolLog?: (log: any) => void;
32
- };
33
- declare const CuekitProvider: React__default.FC<Props>;
36
+ title?: string;
37
+ showLogo?: boolean;
38
+ showAIIcon?: boolean;
39
+ showUserIcon?: boolean;
40
+ }
41
+ declare const AnsyrProvider: React__default.FC<Props>;
34
42
 
35
43
  interface CuekitConfig {
36
44
  apiKey: string;
@@ -44,6 +52,22 @@ interface CuekitConfig {
44
52
  }
45
53
  declare function InitCuekit(config: CuekitConfig): void;
46
54
 
55
+ interface Language {
56
+ code: string;
57
+ name: string;
58
+ flag: string;
59
+ }
60
+ interface LanguageSelectorProps {
61
+ selectedLanguage: Language;
62
+ onLanguageChange: (language: Language) => void;
63
+ availableLanguages: Language[];
64
+ disabled?: boolean;
65
+ className?: string;
66
+ tooltip?: string;
67
+ screenPosition?: 'bottom-center' | 'bottom-left' | 'bottom-right';
68
+ }
69
+ declare const LanguageSelector: React__default.FC<LanguageSelectorProps>;
70
+
47
71
  type ScreenPosition = 'bottom-center' | 'bottom-left' | 'bottom-right';
48
72
  type MicState$1 = 'idle' | 'listening' | 'thinking' | 'replying';
49
73
  type MicButtonProps = {
@@ -58,6 +82,9 @@ type MicButtonProps = {
58
82
  buttonSize?: number;
59
83
  defaultTheme?: 'light' | 'dark' | 'system';
60
84
  showBorderGlow?: boolean;
85
+ language?: Language;
86
+ defaultLanguage?: Language;
87
+ onLanguageChange?: (language: Language) => void;
61
88
  };
62
89
 
63
90
  declare const MicButton: React__default.FC<MicButtonProps>;
@@ -136,7 +163,7 @@ declare const useCuekit: (options?: {
136
163
  setMicState: React.Dispatch<React.SetStateAction<MicState>>;
137
164
  status: string;
138
165
  setStatus: React.Dispatch<React.SetStateAction<string>>;
139
- connect: (identity: string, apiKey?: string, appId?: string) => Promise<void>;
166
+ connect: (identity: string, apiKey?: string, appId?: string, language?: Language) => Promise<void>;
140
167
  disconnect: () => Promise<void>;
141
168
  muteState: MuteState;
142
169
  toggleMute: () => Promise<void>;
@@ -156,6 +183,31 @@ declare const useCuekit: (options?: {
156
183
  audioContainerRef: React.RefObject<HTMLDivElement>;
157
184
  };
158
185
 
186
+ interface Position {
187
+ x: number;
188
+ y: number;
189
+ }
190
+ interface Size {
191
+ width: number;
192
+ height: number;
193
+ }
194
+ interface Bounds {
195
+ minWidth: number;
196
+ minHeight: number;
197
+ maxWidth?: number;
198
+ maxHeight?: number;
199
+ }
200
+ type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
201
+ interface DraggableResizableOptions {
202
+ bounds?: Bounds;
203
+ initialPosition?: Position;
204
+ initialSize?: Size;
205
+ onPositionChange?: (position: Position) => void;
206
+ onSizeChange?: (size: Size) => void;
207
+ disabled?: boolean;
208
+ dragHandle?: string;
209
+ }
210
+
159
211
  interface ChatPopupProps {
160
212
  isOpen: boolean;
161
213
  isMinimized: boolean;
@@ -182,6 +234,15 @@ interface ChatPopupProps {
182
234
  };
183
235
  muteState?: MuteState;
184
236
  onToggleMute?: () => Promise<void>;
237
+ draggable?: boolean;
238
+ resizable?: boolean;
239
+ initialPosition?: Position;
240
+ initialSize?: Size;
241
+ onPositionChange?: (position: Position) => void;
242
+ onSizeChange?: (size: Size) => void;
243
+ persistPosition?: boolean;
244
+ persistSize?: boolean;
245
+ storageKey?: string;
185
246
  }
186
247
  declare const ChatPopup: React__default.FC<ChatPopupProps>;
187
248
 
@@ -199,6 +260,52 @@ interface VoiceIntensityVisualizerProps {
199
260
  }
200
261
  declare const VoiceIntensityVisualizer: React__default.FC<VoiceIntensityVisualizerProps>;
201
262
 
263
+ interface DraggableResizableContainerProps extends Omit<DraggableResizableOptions, 'onPositionChange' | 'onSizeChange'> {
264
+ children: React__default.ReactNode;
265
+ className?: string;
266
+ style?: React__default.CSSProperties;
267
+ dragHandle?: string;
268
+ showResizeHandles?: boolean;
269
+ resizeHandleSize?: number;
270
+ onPositionChange?: (position: Position) => void;
271
+ onSizeChange?: (size: Size) => void;
272
+ onDragStart?: () => void;
273
+ onDragEnd?: () => void;
274
+ onResizeStart?: () => void;
275
+ onResizeEnd?: () => void;
276
+ storageKey?: string;
277
+ persistPosition?: boolean;
278
+ persistSize?: boolean;
279
+ }
280
+ declare const DraggableResizableContainer: React__default.FC<DraggableResizableContainerProps>;
281
+ declare const useDraggableResizableContainer: (storageKey?: string) => {
282
+ loadData: () => any;
283
+ saveData: (data: {
284
+ position?: Position;
285
+ size?: Size;
286
+ }) => void;
287
+ clearData: () => void;
288
+ };
289
+
290
+ interface ResizeHandleProps {
291
+ direction: ResizeDirection;
292
+ onMouseDown: (e: React__default.MouseEvent) => void;
293
+ disabled?: boolean;
294
+ className?: string;
295
+ style?: React__default.CSSProperties;
296
+ size?: number;
297
+ }
298
+ declare const ResizeHandle: React__default.FC<ResizeHandleProps>;
299
+ interface ResizeHandlesProps {
300
+ onResizeStart: (direction: ResizeDirection) => (e: React__default.MouseEvent) => void;
301
+ disabled?: boolean;
302
+ className?: string;
303
+ style?: React__default.CSSProperties;
304
+ size?: number;
305
+ showHandles?: ResizeDirection[];
306
+ }
307
+ declare const ResizeHandles: React__default.FC<ResizeHandlesProps>;
308
+
202
309
  declare const useWebRTC: (options?: {
203
310
  onNavigationCommand?: (command: NavigationCommand) => void;
204
311
  onConnectionStateChange?: (state: ConnectionState) => void;
@@ -216,7 +323,7 @@ declare const useWebRTC: (options?: {
216
323
  roomName: string | null;
217
324
  participants: string[];
218
325
  error: string | null;
219
- connect: (identity: string, apiKey?: string, appId?: string) => Promise<AuthResponse | undefined>;
326
+ connect: (identity: string, apiKey?: string, appId?: string, language?: Language) => Promise<AuthResponse | undefined>;
220
327
  disconnect: () => Promise<void>;
221
328
  sendData: typeof sendData;
222
329
  sendScreenStatus: typeof sendScreenStatus;
@@ -307,4 +414,4 @@ declare function getCurrentPathParams(): Record<string, string>;
307
414
  */
308
415
  declare function resolveRoutePath(routePath: string, params: Record<string, string>): string;
309
416
 
310
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMStructurePayload, type ElementAction, InitCuekit, type InteractiveElement, MicButton, type MicButtonProps, type MicState$1 as MicState, type MuteState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureAllInteractiveElements, clearElementCache, configureWebRTCServer, executeAction, generateDynamicId, getCurrentPathParams, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, resolveRoutePath, useCuekit, useQubeContext, useWebRTC, validateDynamicElements };
417
+ export { AnsyrProvider, BorderGlow, type Bounds, ChatPopup, type ChatPopupProps, type Props as CuekitProviderProps, type DOMStructurePayload, DraggableResizableContainer, type DraggableResizableContainerProps, type ElementAction, InitCuekit, type InteractiveElement, type Language, LanguageSelector, type LanguageSelectorProps, MicButton, type MicButtonProps, type MicState$1 as MicState, type MuteState, type NavigationCommand, type Position, type ResizeDirection, ResizeHandle, type ResizeHandleProps, ResizeHandles, type ResizeHandlesProps, type ServerConfig, type Size, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureAllInteractiveElements, clearElementCache, configureWebRTCServer, executeAction, generateDynamicId, getCurrentPathParams, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, resolveRoutePath, useAnsyrContext, useCuekit, useDraggableResizableContainer, useWebRTC, validateDynamicElements };
package/dist/index.d.ts CHANGED
@@ -4,23 +4,27 @@ import * as livekit_client from 'livekit-client';
4
4
  import { ConnectionState, Room } from 'livekit-client';
5
5
 
6
6
  declare global {
7
- interface CueKitGlobalStore {
7
+ interface AnsyrGlobalStore {
8
8
  intent: string | null;
9
9
  lastText: string;
10
10
  lastClickedLabel: string;
11
11
  apiKey?: string;
12
12
  appId?: string;
13
13
  deviceId?: string;
14
- update: (data: Partial<CueKitGlobalStore>) => void;
14
+ update: (data: Partial<AnsyrGlobalStore>) => void;
15
15
  }
16
- var CuekitStore: CueKitGlobalStore;
16
+ var AnsyrStore: AnsyrGlobalStore;
17
17
  }
18
- type QubeCtx = {
18
+ type AnsyrCtx = {
19
19
  apiKey: string;
20
20
  appId: string;
21
+ title: string;
22
+ showLogo: boolean;
23
+ showAIIcon: boolean;
24
+ showUserIcon: boolean;
21
25
  };
22
- declare const useQubeContext: () => QubeCtx;
23
- type Props = {
26
+ declare const useAnsyrContext: () => AnsyrCtx;
27
+ interface Props {
24
28
  apiKey: string;
25
29
  deviceId?: string;
26
30
  appId: string;
@@ -29,8 +33,12 @@ type Props = {
29
33
  onConnectionStateChange?: (state: any) => void;
30
34
  onParticipantUpdate?: (participants: string[]) => void;
31
35
  onToolLog?: (log: any) => void;
32
- };
33
- declare const CuekitProvider: React__default.FC<Props>;
36
+ title?: string;
37
+ showLogo?: boolean;
38
+ showAIIcon?: boolean;
39
+ showUserIcon?: boolean;
40
+ }
41
+ declare const AnsyrProvider: React__default.FC<Props>;
34
42
 
35
43
  interface CuekitConfig {
36
44
  apiKey: string;
@@ -44,6 +52,22 @@ interface CuekitConfig {
44
52
  }
45
53
  declare function InitCuekit(config: CuekitConfig): void;
46
54
 
55
+ interface Language {
56
+ code: string;
57
+ name: string;
58
+ flag: string;
59
+ }
60
+ interface LanguageSelectorProps {
61
+ selectedLanguage: Language;
62
+ onLanguageChange: (language: Language) => void;
63
+ availableLanguages: Language[];
64
+ disabled?: boolean;
65
+ className?: string;
66
+ tooltip?: string;
67
+ screenPosition?: 'bottom-center' | 'bottom-left' | 'bottom-right';
68
+ }
69
+ declare const LanguageSelector: React__default.FC<LanguageSelectorProps>;
70
+
47
71
  type ScreenPosition = 'bottom-center' | 'bottom-left' | 'bottom-right';
48
72
  type MicState$1 = 'idle' | 'listening' | 'thinking' | 'replying';
49
73
  type MicButtonProps = {
@@ -58,6 +82,9 @@ type MicButtonProps = {
58
82
  buttonSize?: number;
59
83
  defaultTheme?: 'light' | 'dark' | 'system';
60
84
  showBorderGlow?: boolean;
85
+ language?: Language;
86
+ defaultLanguage?: Language;
87
+ onLanguageChange?: (language: Language) => void;
61
88
  };
62
89
 
63
90
  declare const MicButton: React__default.FC<MicButtonProps>;
@@ -136,7 +163,7 @@ declare const useCuekit: (options?: {
136
163
  setMicState: React.Dispatch<React.SetStateAction<MicState>>;
137
164
  status: string;
138
165
  setStatus: React.Dispatch<React.SetStateAction<string>>;
139
- connect: (identity: string, apiKey?: string, appId?: string) => Promise<void>;
166
+ connect: (identity: string, apiKey?: string, appId?: string, language?: Language) => Promise<void>;
140
167
  disconnect: () => Promise<void>;
141
168
  muteState: MuteState;
142
169
  toggleMute: () => Promise<void>;
@@ -156,6 +183,31 @@ declare const useCuekit: (options?: {
156
183
  audioContainerRef: React.RefObject<HTMLDivElement>;
157
184
  };
158
185
 
186
+ interface Position {
187
+ x: number;
188
+ y: number;
189
+ }
190
+ interface Size {
191
+ width: number;
192
+ height: number;
193
+ }
194
+ interface Bounds {
195
+ minWidth: number;
196
+ minHeight: number;
197
+ maxWidth?: number;
198
+ maxHeight?: number;
199
+ }
200
+ type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
201
+ interface DraggableResizableOptions {
202
+ bounds?: Bounds;
203
+ initialPosition?: Position;
204
+ initialSize?: Size;
205
+ onPositionChange?: (position: Position) => void;
206
+ onSizeChange?: (size: Size) => void;
207
+ disabled?: boolean;
208
+ dragHandle?: string;
209
+ }
210
+
159
211
  interface ChatPopupProps {
160
212
  isOpen: boolean;
161
213
  isMinimized: boolean;
@@ -182,6 +234,15 @@ interface ChatPopupProps {
182
234
  };
183
235
  muteState?: MuteState;
184
236
  onToggleMute?: () => Promise<void>;
237
+ draggable?: boolean;
238
+ resizable?: boolean;
239
+ initialPosition?: Position;
240
+ initialSize?: Size;
241
+ onPositionChange?: (position: Position) => void;
242
+ onSizeChange?: (size: Size) => void;
243
+ persistPosition?: boolean;
244
+ persistSize?: boolean;
245
+ storageKey?: string;
185
246
  }
186
247
  declare const ChatPopup: React__default.FC<ChatPopupProps>;
187
248
 
@@ -199,6 +260,52 @@ interface VoiceIntensityVisualizerProps {
199
260
  }
200
261
  declare const VoiceIntensityVisualizer: React__default.FC<VoiceIntensityVisualizerProps>;
201
262
 
263
+ interface DraggableResizableContainerProps extends Omit<DraggableResizableOptions, 'onPositionChange' | 'onSizeChange'> {
264
+ children: React__default.ReactNode;
265
+ className?: string;
266
+ style?: React__default.CSSProperties;
267
+ dragHandle?: string;
268
+ showResizeHandles?: boolean;
269
+ resizeHandleSize?: number;
270
+ onPositionChange?: (position: Position) => void;
271
+ onSizeChange?: (size: Size) => void;
272
+ onDragStart?: () => void;
273
+ onDragEnd?: () => void;
274
+ onResizeStart?: () => void;
275
+ onResizeEnd?: () => void;
276
+ storageKey?: string;
277
+ persistPosition?: boolean;
278
+ persistSize?: boolean;
279
+ }
280
+ declare const DraggableResizableContainer: React__default.FC<DraggableResizableContainerProps>;
281
+ declare const useDraggableResizableContainer: (storageKey?: string) => {
282
+ loadData: () => any;
283
+ saveData: (data: {
284
+ position?: Position;
285
+ size?: Size;
286
+ }) => void;
287
+ clearData: () => void;
288
+ };
289
+
290
+ interface ResizeHandleProps {
291
+ direction: ResizeDirection;
292
+ onMouseDown: (e: React__default.MouseEvent) => void;
293
+ disabled?: boolean;
294
+ className?: string;
295
+ style?: React__default.CSSProperties;
296
+ size?: number;
297
+ }
298
+ declare const ResizeHandle: React__default.FC<ResizeHandleProps>;
299
+ interface ResizeHandlesProps {
300
+ onResizeStart: (direction: ResizeDirection) => (e: React__default.MouseEvent) => void;
301
+ disabled?: boolean;
302
+ className?: string;
303
+ style?: React__default.CSSProperties;
304
+ size?: number;
305
+ showHandles?: ResizeDirection[];
306
+ }
307
+ declare const ResizeHandles: React__default.FC<ResizeHandlesProps>;
308
+
202
309
  declare const useWebRTC: (options?: {
203
310
  onNavigationCommand?: (command: NavigationCommand) => void;
204
311
  onConnectionStateChange?: (state: ConnectionState) => void;
@@ -216,7 +323,7 @@ declare const useWebRTC: (options?: {
216
323
  roomName: string | null;
217
324
  participants: string[];
218
325
  error: string | null;
219
- connect: (identity: string, apiKey?: string, appId?: string) => Promise<AuthResponse | undefined>;
326
+ connect: (identity: string, apiKey?: string, appId?: string, language?: Language) => Promise<AuthResponse | undefined>;
220
327
  disconnect: () => Promise<void>;
221
328
  sendData: typeof sendData;
222
329
  sendScreenStatus: typeof sendScreenStatus;
@@ -307,4 +414,4 @@ declare function getCurrentPathParams(): Record<string, string>;
307
414
  */
308
415
  declare function resolveRoutePath(routePath: string, params: Record<string, string>): string;
309
416
 
310
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMStructurePayload, type ElementAction, InitCuekit, type InteractiveElement, MicButton, type MicButtonProps, type MicState$1 as MicState, type MuteState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureAllInteractiveElements, clearElementCache, configureWebRTCServer, executeAction, generateDynamicId, getCurrentPathParams, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, resolveRoutePath, useCuekit, useQubeContext, useWebRTC, validateDynamicElements };
417
+ export { AnsyrProvider, BorderGlow, type Bounds, ChatPopup, type ChatPopupProps, type Props as CuekitProviderProps, type DOMStructurePayload, DraggableResizableContainer, type DraggableResizableContainerProps, type ElementAction, InitCuekit, type InteractiveElement, type Language, LanguageSelector, type LanguageSelectorProps, MicButton, type MicButtonProps, type MicState$1 as MicState, type MuteState, type NavigationCommand, type Position, type ResizeDirection, ResizeHandle, type ResizeHandleProps, ResizeHandles, type ResizeHandlesProps, type ServerConfig, type Size, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureAllInteractiveElements, clearElementCache, configureWebRTCServer, executeAction, generateDynamicId, getCurrentPathParams, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, resolveRoutePath, useAnsyrContext, useCuekit, useDraggableResizableContainer, useWebRTC, validateDynamicElements };