@cuekit-ai/react 1.0.0 → 1.1.2
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/README.md +285 -160
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +716 -160
- package/dist/index.mjs +712 -160
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,289 +1,414 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cuekit-ai/react
|
|
2
2
|
|
|
3
|
-
A powerful
|
|
3
|
+
A powerful React SDK for integrating AI-powered voice interactions into your web applications. Built with TypeScript and designed for seamless voice navigation, commands, and interactions.
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/%40cuekit-ai%2Freact)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
7
|
|
|
5
8
|
## 🚀 Features
|
|
6
9
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
10
|
+
- **🎤 Voice Recognition**: Real-time speech-to-text with high accuracy
|
|
11
|
+
- **🤖 AI-Powered Navigation**: Intelligent voice commands for app navigation
|
|
12
|
+
- **🎯 Intent Recognition**: Understands user intent and performs actions
|
|
13
|
+
- **🔊 Text-to-Speech**: Natural voice responses using ElevenLabs
|
|
14
|
+
- **🎨 Beautiful UI**: Modern, animated voice assistant interface
|
|
15
|
+
- **📱 Responsive Design**: Works seamlessly across all devices
|
|
16
|
+
- **⚡ Real-time Processing**: Instant voice command processing
|
|
17
|
+
- **🔄 State Management**: Robust state handling for voice interactions
|
|
18
|
+
- **🎭 Portal Rendering**: Modal components render at document body level
|
|
19
|
+
- **✨ Visual Feedback**: Border glow effects and animations
|
|
15
20
|
|
|
16
21
|
## 📦 Installation
|
|
17
22
|
|
|
18
23
|
```bash
|
|
19
|
-
npm install cuekit-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
npm install @cuekit-ai/react
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add @cuekit-ai/react
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add @cuekit-ai/react
|
|
33
|
+
```
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
## 🎯 Quick Start
|
|
27
36
|
|
|
28
|
-
Wrap your app with
|
|
37
|
+
### 1. Wrap your app with CuekitProvider
|
|
29
38
|
|
|
30
39
|
```tsx
|
|
31
|
-
import { CuekitProvider } from 'cuekit-
|
|
40
|
+
import { CuekitProvider } from '@cuekit-ai/react'
|
|
32
41
|
|
|
33
42
|
function App() {
|
|
34
43
|
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
<CuekitProvider
|
|
45
|
+
apiKey="your-api-key"
|
|
46
|
+
appId="your-app-id"
|
|
47
|
+
deviceId="optional-device-id"
|
|
48
|
+
navigationHandler={(path, params) => {
|
|
49
|
+
const qs = params ? `?${new URLSearchParams(params).toString()}` : ''
|
|
50
|
+
// Example with Next.js App Router
|
|
51
|
+
router.push(`${path}${qs}`)
|
|
52
|
+
// Or with React Router v6
|
|
53
|
+
// navigate(`${path}${qs}`)
|
|
54
|
+
}}
|
|
38
55
|
)
|
|
39
56
|
}
|
|
40
57
|
```
|
|
41
58
|
|
|
42
|
-
### 2. Add
|
|
43
|
-
|
|
44
|
-
Add the `MicButton` component to enable voice interactions:
|
|
59
|
+
### 2. Add the MicButton component
|
|
45
60
|
|
|
46
61
|
```tsx
|
|
47
|
-
import { MicButton } from 'cuekit-
|
|
62
|
+
import { MicButton } from '@cuekit-ai/react'
|
|
48
63
|
|
|
49
64
|
function YourApp() {
|
|
50
65
|
return (
|
|
51
66
|
<div>
|
|
52
|
-
|
|
53
|
-
<MicButton
|
|
67
|
+
<h1>My Voice-Enabled App</h1>
|
|
68
|
+
<MicButton
|
|
69
|
+
screenPosition="bottom-right"
|
|
70
|
+
buttonStyle={{
|
|
71
|
+
backgroundColor: 'blue',
|
|
72
|
+
borderRadius: '50%',
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
54
75
|
</div>
|
|
55
76
|
)
|
|
56
77
|
}
|
|
57
78
|
```
|
|
58
79
|
|
|
59
|
-
|
|
80
|
+
## 🎨 Components
|
|
60
81
|
|
|
61
|
-
|
|
82
|
+
### MicButton
|
|
62
83
|
|
|
63
|
-
|
|
64
|
-
import { InitCuekit } from 'cuekit-web-sdk'
|
|
84
|
+
The main voice interaction component with a beautiful animated interface.
|
|
65
85
|
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
```tsx
|
|
87
|
+
import { MicButton } from '@cuekit-ai/react'
|
|
88
|
+
;<MicButton
|
|
89
|
+
screenPosition="bottom-right" // 'bottom-left' | 'bottom-center' | 'bottom-right'
|
|
90
|
+
buttonStyle={
|
|
91
|
+
{
|
|
92
|
+
/* custom styles */
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
buttonSize={60}
|
|
96
|
+
hasText={false}
|
|
97
|
+
text="Voice Assistant"
|
|
98
|
+
textStyle={
|
|
99
|
+
{
|
|
100
|
+
/* text styles */
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
imageSource="path/to/image.png"
|
|
104
|
+
imageStyle={
|
|
105
|
+
{
|
|
106
|
+
/* image styles */
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/>
|
|
68
110
|
```
|
|
69
111
|
|
|
70
|
-
|
|
112
|
+
#### Props
|
|
113
|
+
|
|
114
|
+
| Prop | Type | Default | Description |
|
|
115
|
+
| ---------------- | ---------------------------------------------------- | ---------------- | ------------------------------------ |
|
|
116
|
+
| `screenPosition` | `'bottom-left' \| 'bottom-center' \| 'bottom-right'` | `'bottom-right'` | Position of the mic button |
|
|
117
|
+
| `buttonStyle` | `React.CSSProperties` | `{}` | Custom styles for the button |
|
|
118
|
+
| `buttonSize` | `number` | `60` | Size of the button in pixels |
|
|
119
|
+
| `hasText` | `boolean` | `false` | Whether to show text with the button |
|
|
120
|
+
| `text` | `string` | `'CueKit VC'` | Text to display with the button |
|
|
121
|
+
| `textStyle` | `React.CSSProperties` | `{}` | Styles for the text |
|
|
122
|
+
| `imageSource` | `string` | `undefined` | Image source for the button |
|
|
123
|
+
| `imageStyle` | `React.CSSProperties` | `{}` | Styles for the image |
|
|
71
124
|
|
|
72
125
|
### CuekitProvider
|
|
73
126
|
|
|
74
|
-
The
|
|
127
|
+
The context provider that initializes the voice assistant.
|
|
75
128
|
|
|
76
129
|
```tsx
|
|
77
|
-
|
|
130
|
+
import { CuekitProvider } from '@cuekit-ai/react'
|
|
131
|
+
|
|
132
|
+
;<CuekitProvider
|
|
78
133
|
apiKey="your-api-key"
|
|
79
134
|
appId="your-app-id"
|
|
80
135
|
deviceId="optional-device-id"
|
|
81
|
-
|
|
136
|
+
navigationHandler={(path, params) => {
|
|
137
|
+
const qs = params ? `?${new URLSearchParams(params).toString()}` : ''
|
|
138
|
+
// Example with Next.js App Router
|
|
139
|
+
router.push(`${path}${qs}`)
|
|
140
|
+
// Or with React Router v6
|
|
141
|
+
// navigate(`${path}${qs}`)
|
|
142
|
+
}}
|
|
82
143
|
>
|
|
83
144
|
{children}
|
|
84
145
|
</CuekitProvider>
|
|
85
146
|
```
|
|
86
147
|
|
|
87
|
-
|
|
148
|
+
#### Props
|
|
88
149
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
150
|
+
| Prop | Type | Required | Description |
|
|
151
|
+
| ------------------- | ------------------------------------------------------ | -------- | -------------------------------------------------------------------------- |
|
|
152
|
+
| `apiKey` | `string` | ✅ | Your CueKit API key |
|
|
153
|
+
| `appId` | `string` | ✅ | Your application ID |
|
|
154
|
+
| `deviceId` | `string` | ❌ | Unique device identifier (auto-generated if not provided) |
|
|
155
|
+
| `navigationHandler` | `(path: string, params?: Record<string, any>) => void` | ❌ | Custom router handler. If not provided, falls back to internal navigation. |
|
|
156
|
+
| `children` | `ReactNode` | ✅ | Your app components |
|
|
94
157
|
|
|
95
|
-
###
|
|
158
|
+
### Routing integration
|
|
159
|
+
|
|
160
|
+
You can integrate your app's router by passing a `navigationHandler` to `CuekitProvider`.
|
|
96
161
|
|
|
97
|
-
|
|
162
|
+
Next.js App Router example:
|
|
98
163
|
|
|
99
164
|
```tsx
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
165
|
+
'use client'
|
|
166
|
+
import { useEffect } from 'react'
|
|
167
|
+
import { useRouter } from 'next/navigation'
|
|
168
|
+
import { CuekitProvider } from '@cuekit-ai/react'
|
|
169
|
+
|
|
170
|
+
export default function Providers({ children }: { children: React.ReactNode }) {
|
|
171
|
+
const router = useRouter()
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<CuekitProvider
|
|
175
|
+
apiKey={process.env.NEXT_PUBLIC_CUEKIT_API_KEY!}
|
|
176
|
+
appId={process.env.NEXT_PUBLIC_CUEKIT_APP_ID!}
|
|
177
|
+
navigationHandler={(path, params) => {
|
|
178
|
+
const qs = params ? `?${new URLSearchParams(params).toString()}` : ''
|
|
179
|
+
router.push(`${path}${qs}`)
|
|
180
|
+
}}
|
|
181
|
+
>
|
|
182
|
+
{children}
|
|
183
|
+
</CuekitProvider>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
108
186
|
```
|
|
109
187
|
|
|
110
|
-
|
|
188
|
+
React Router v6 example:
|
|
111
189
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
190
|
+
```tsx
|
|
191
|
+
import { useNavigate } from 'react-router-dom'
|
|
192
|
+
import { CuekitProvider } from '@cuekit-ai/react'
|
|
193
|
+
|
|
194
|
+
function AppProviders({ children }: { children: React.ReactNode }) {
|
|
195
|
+
const navigate = useNavigate()
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<CuekitProvider
|
|
199
|
+
apiKey={import.meta.env.VITE_CUEKIT_API_KEY}
|
|
200
|
+
appId={import.meta.env.VITE_CUEKIT_APP_ID}
|
|
201
|
+
navigationHandler={(path, params) => {
|
|
202
|
+
const qs = params ? `?${new URLSearchParams(params).toString()}` : ''
|
|
203
|
+
navigate(`${path}${qs}`)
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
{children}
|
|
207
|
+
</CuekitProvider>
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
```
|
|
120
211
|
|
|
121
|
-
##
|
|
212
|
+
## 🔧 Hooks
|
|
122
213
|
|
|
123
|
-
### useVoice
|
|
214
|
+
### useVoice
|
|
124
215
|
|
|
125
|
-
|
|
216
|
+
Hook for voice recognition and processing.
|
|
126
217
|
|
|
127
218
|
```tsx
|
|
128
|
-
import { useVoice } from 'cuekit-
|
|
219
|
+
import { useVoice } from '@cuekit-ai/react'
|
|
129
220
|
|
|
130
|
-
function
|
|
221
|
+
function MyComponent() {
|
|
131
222
|
const { isListening, start, stop, transcript } = useVoice()
|
|
132
223
|
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
await stop()
|
|
136
|
-
} else {
|
|
137
|
-
await start('Hello, how can I help you?')
|
|
138
|
-
}
|
|
224
|
+
const handleVoiceStart = () => {
|
|
225
|
+
start('Hello, how can I help you?')
|
|
139
226
|
}
|
|
140
227
|
|
|
141
|
-
|
|
228
|
+
const handleVoiceStop = () => {
|
|
229
|
+
stop()
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<div>
|
|
234
|
+
<p>Listening: {isListening ? 'Yes' : 'No'}</p>
|
|
235
|
+
<p>Transcript: {transcript}</p>
|
|
236
|
+
<button onClick={handleVoiceStart}>Start Listening</button>
|
|
237
|
+
<button onClick={handleVoiceStop}>Stop Listening</button>
|
|
238
|
+
</div>
|
|
239
|
+
)
|
|
142
240
|
}
|
|
143
241
|
```
|
|
144
242
|
|
|
145
|
-
###
|
|
243
|
+
### useAudioController
|
|
146
244
|
|
|
147
|
-
|
|
245
|
+
Hook for audio playback control.
|
|
148
246
|
|
|
149
247
|
```tsx
|
|
150
|
-
import {
|
|
248
|
+
import { useAudioController } from '@cuekit-ai/react'
|
|
151
249
|
|
|
152
|
-
function
|
|
153
|
-
const {
|
|
250
|
+
function AudioComponent() {
|
|
251
|
+
const { play, pause, stop, isPlaying } = useAudioController()
|
|
154
252
|
|
|
155
|
-
|
|
253
|
+
return (
|
|
254
|
+
<div>
|
|
255
|
+
<button onClick={play}>Play</button>
|
|
256
|
+
<button onClick={pause}>Pause</button>
|
|
257
|
+
<button onClick={stop}>Stop</button>
|
|
258
|
+
<p>Playing: {isPlaying ? 'Yes' : 'No'}</p>
|
|
259
|
+
</div>
|
|
260
|
+
)
|
|
156
261
|
}
|
|
157
262
|
```
|
|
158
263
|
|
|
159
|
-
|
|
264
|
+
### useVoiceRecognition
|
|
160
265
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Process voice input manually:
|
|
266
|
+
Hook for advanced voice recognition features.
|
|
164
267
|
|
|
165
268
|
```tsx
|
|
166
|
-
import {
|
|
269
|
+
import { useVoiceRecognition } from '@cuekit-ai/react'
|
|
167
270
|
|
|
168
|
-
|
|
169
|
-
const
|
|
271
|
+
function VoiceRecognitionComponent() {
|
|
272
|
+
const { isListening, transcript, startListening, stopListening, resetTranscript } =
|
|
273
|
+
useVoiceRecognition()
|
|
170
274
|
|
|
171
|
-
|
|
275
|
+
return (
|
|
276
|
+
<div>
|
|
277
|
+
<button onClick={startListening}>Start</button>
|
|
278
|
+
<button onClick={stopListening}>Stop</button>
|
|
279
|
+
<button onClick={resetTranscript}>Reset</button>
|
|
280
|
+
<p>Transcript: {transcript}</p>
|
|
281
|
+
</div>
|
|
282
|
+
)
|
|
172
283
|
}
|
|
173
284
|
```
|
|
174
285
|
|
|
175
|
-
|
|
286
|
+
## 🛠️ Utilities
|
|
287
|
+
|
|
288
|
+
### processVoice
|
|
176
289
|
|
|
177
|
-
|
|
290
|
+
Process voice commands and execute actions.
|
|
178
291
|
|
|
179
292
|
```tsx
|
|
180
|
-
import {
|
|
293
|
+
import { processVoice } from '@cuekit-ai/react'
|
|
181
294
|
|
|
182
|
-
|
|
183
|
-
const
|
|
295
|
+
const handleVoiceCommand = async (transcript: string) => {
|
|
296
|
+
const result = await processVoice(transcript, apiKey, appId, deviceId)
|
|
184
297
|
|
|
185
|
-
|
|
186
|
-
|
|
298
|
+
if (result) {
|
|
299
|
+
console.log('Voice command processed:', result)
|
|
187
300
|
}
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<div>
|
|
191
|
-
<button onClick={handleSpeak}>Speak</button>
|
|
192
|
-
<button onClick={stop}>Stop</button>
|
|
193
|
-
{isSpeaking && <span>Speaking...</span>}
|
|
194
|
-
</div>
|
|
195
|
-
)
|
|
196
301
|
}
|
|
197
302
|
```
|
|
198
303
|
|
|
199
|
-
###
|
|
304
|
+
### onStateChange
|
|
200
305
|
|
|
201
|
-
|
|
306
|
+
Handle navigation state changes.
|
|
202
307
|
|
|
203
308
|
```tsx
|
|
204
|
-
import { onStateChange } from 'cuekit-
|
|
309
|
+
import { onStateChange } from '@cuekit-ai/react'
|
|
205
310
|
|
|
206
|
-
//
|
|
207
|
-
|
|
311
|
+
// Automatically called by CuekitProvider
|
|
312
|
+
// Handles route changes and voice command re-triggering
|
|
208
313
|
```
|
|
209
314
|
|
|
210
|
-
##
|
|
315
|
+
## 🎯 Voice Commands
|
|
316
|
+
|
|
317
|
+
The SDK supports various voice commands for navigation and interaction:
|
|
318
|
+
|
|
319
|
+
### Navigation Commands
|
|
320
|
+
|
|
321
|
+
- "Go to home"
|
|
322
|
+
- "Navigate to settings"
|
|
323
|
+
- "Open profile page"
|
|
324
|
+
- "Go back"
|
|
325
|
+
|
|
326
|
+
### Action Commands
|
|
327
|
+
|
|
328
|
+
- "Click the submit button"
|
|
329
|
+
- "Press the login button"
|
|
330
|
+
- "Select the first option"
|
|
331
|
+
- "Scroll down"
|
|
332
|
+
|
|
333
|
+
### Information Commands
|
|
211
334
|
|
|
212
|
-
|
|
335
|
+
- "What's on this page?"
|
|
336
|
+
- "Tell me about this screen"
|
|
337
|
+
- "What can I do here?"
|
|
338
|
+
|
|
339
|
+
## 🎨 Styling
|
|
340
|
+
|
|
341
|
+
### Custom Button Styling
|
|
213
342
|
|
|
214
343
|
```tsx
|
|
215
344
|
<MicButton
|
|
216
345
|
buttonStyle={{
|
|
217
|
-
backgroundColor: '#
|
|
218
|
-
boxShadow: '0 4px
|
|
219
|
-
|
|
220
|
-
}}
|
|
221
|
-
textStyle={{
|
|
222
|
-
fontSize: '16px',
|
|
223
|
-
fontWeight: 'bold',
|
|
224
|
-
color: '#fff',
|
|
346
|
+
backgroundColor: 'linear-gradient(45deg, #667eea 0%, #764ba2 100%)',
|
|
347
|
+
boxShadow: '0 4px 15px rgba(0, 0, 0, 0.2)',
|
|
348
|
+
transform: 'scale(1.1)',
|
|
225
349
|
}}
|
|
226
350
|
/>
|
|
227
351
|
```
|
|
228
352
|
|
|
229
|
-
### Custom
|
|
353
|
+
### Custom Modal Styling
|
|
230
354
|
|
|
231
|
-
|
|
232
|
-
// Bottom right (default)
|
|
233
|
-
<MicButton screenPosition="bottom-right" />
|
|
355
|
+
The modal automatically adapts to your app's theme and provides:
|
|
234
356
|
|
|
235
|
-
|
|
236
|
-
|
|
357
|
+
- Beautiful gradient backgrounds
|
|
358
|
+
- Smooth animations
|
|
359
|
+
- Responsive design
|
|
360
|
+
- Accessibility features
|
|
237
361
|
|
|
238
|
-
|
|
239
|
-
|
|
362
|
+
```env
|
|
363
|
+
CUEKIT_API_KEY=your-api-key
|
|
364
|
+
CUEKIT_APP_ID=your-app-id
|
|
365
|
+
CUEKIT_DEVICE_ID=optional-device-id
|
|
240
366
|
```
|
|
241
367
|
|
|
242
|
-
|
|
368
|
+
### API Configuration
|
|
243
369
|
|
|
244
|
-
The SDK
|
|
370
|
+
The SDK communicates with the CueKit API for:
|
|
245
371
|
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
372
|
+
- Voice command processing
|
|
373
|
+
- Intent recognition
|
|
374
|
+
- Navigation handling
|
|
375
|
+
- Text-to-speech synthesis
|
|
250
376
|
|
|
251
|
-
|
|
377
|
+
## 🔒 Security
|
|
252
378
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
component?: {
|
|
258
|
-
hash: string
|
|
259
|
-
text: string
|
|
260
|
-
componentType: string
|
|
261
|
-
}
|
|
262
|
-
text?: string
|
|
263
|
-
claudeError?: boolean
|
|
264
|
-
errorMessage?: string
|
|
265
|
-
}
|
|
266
|
-
```
|
|
379
|
+
- All API calls are made over HTTPS
|
|
380
|
+
- API keys are stored securely
|
|
381
|
+
- No sensitive data is logged
|
|
382
|
+
- Device IDs are anonymized
|
|
267
383
|
|
|
268
|
-
##
|
|
384
|
+
## 🚀 Performance
|
|
385
|
+
|
|
386
|
+
- Lightweight bundle (~40KB gzipped)
|
|
387
|
+
- Optimized for React 18+
|
|
388
|
+
- Efficient re-rendering
|
|
389
|
+
- Minimal memory footprint
|
|
390
|
+
|
|
391
|
+
## 🐛 Troubleshooting
|
|
269
392
|
|
|
270
|
-
|
|
271
|
-
- Device IDs are automatically generated and persisted
|
|
272
|
-
- Network requests are validated and error-handled
|
|
273
|
-
- No sensitive data is logged to console
|
|
393
|
+
### Common Issues
|
|
274
394
|
|
|
275
|
-
|
|
395
|
+
1. **Mic not working**
|
|
276
396
|
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
- Edge
|
|
397
|
+
- Check browser permissions
|
|
398
|
+
- Ensure HTTPS connection
|
|
399
|
+
- Verify API key is valid
|
|
281
400
|
|
|
282
|
-
**
|
|
401
|
+
2. **Voice commands not recognized**
|
|
283
402
|
|
|
284
|
-
|
|
403
|
+
- Check internet connection
|
|
404
|
+
- Verify app ID is correct
|
|
405
|
+
- Ensure proper CuekitProvider setup
|
|
285
406
|
|
|
286
|
-
|
|
407
|
+
3. **Modal not appearing**
|
|
408
|
+
- Check z-index conflicts
|
|
409
|
+
- Verify portal rendering
|
|
410
|
+
- Ensure proper state management
|
|
287
411
|
|
|
412
|
+
---
|
|
288
413
|
|
|
289
|
-
**
|
|
414
|
+
**Made with ❤️ by [CueKit](https://cuekit.ai)**
|
package/dist/index.d.mts
CHANGED
|
@@ -19,7 +19,7 @@ type Props = {
|
|
|
19
19
|
deviceId?: string;
|
|
20
20
|
appId: string;
|
|
21
21
|
children: ReactNode;
|
|
22
|
-
|
|
22
|
+
navigationHandler?: (path: string, params?: Record<string, any>) => void;
|
|
23
23
|
};
|
|
24
24
|
declare const CuekitProvider: React.FC<Props>;
|
|
25
25
|
|
|
@@ -29,6 +29,11 @@ declare const useAudioController: () => {
|
|
|
29
29
|
play: (url: string) => Promise<void>;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
type NavigationHandler = (path: string, params?: Record<string, any>) => void;
|
|
33
|
+
declare const setNavigator: (navigator: any) => void;
|
|
34
|
+
declare const setNavigationHandler: (handler: NavigationHandler | null) => void;
|
|
35
|
+
declare const navigate: (path: string, params?: Record<string, any>) => void;
|
|
36
|
+
declare const safeNavigate: (name: string | undefined, params?: Record<string, any>) => void;
|
|
32
37
|
declare function onStateChange(): void;
|
|
33
38
|
|
|
34
39
|
type ScreenPosition = 'bottom-center' | 'bottom-left' | 'bottom-right';
|
|
@@ -46,7 +51,7 @@ type MicButtonProps = {
|
|
|
46
51
|
|
|
47
52
|
declare const MicButton: React.FC<MicButtonProps>;
|
|
48
53
|
|
|
49
|
-
declare function InitCuekit(apiKey: string
|
|
54
|
+
declare function InitCuekit(apiKey: string): void;
|
|
50
55
|
|
|
51
56
|
declare const useVoiceRecognition: (lang?: string) => {
|
|
52
57
|
isListening: boolean;
|
|
@@ -55,4 +60,4 @@ declare const useVoiceRecognition: (lang?: string) => {
|
|
|
55
60
|
speechText: string;
|
|
56
61
|
};
|
|
57
62
|
|
|
58
|
-
export { CuekitProvider, InitCuekit, MicButton, onStateChange, processVoice, useAudioController, useVoiceRecognition };
|
|
63
|
+
export { CuekitProvider, InitCuekit, MicButton, navigate, onStateChange, processVoice, safeNavigate, setNavigationHandler, setNavigator, useAudioController, useVoiceRecognition };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ type Props = {
|
|
|
19
19
|
deviceId?: string;
|
|
20
20
|
appId: string;
|
|
21
21
|
children: ReactNode;
|
|
22
|
-
|
|
22
|
+
navigationHandler?: (path: string, params?: Record<string, any>) => void;
|
|
23
23
|
};
|
|
24
24
|
declare const CuekitProvider: React.FC<Props>;
|
|
25
25
|
|
|
@@ -29,6 +29,11 @@ declare const useAudioController: () => {
|
|
|
29
29
|
play: (url: string) => Promise<void>;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
type NavigationHandler = (path: string, params?: Record<string, any>) => void;
|
|
33
|
+
declare const setNavigator: (navigator: any) => void;
|
|
34
|
+
declare const setNavigationHandler: (handler: NavigationHandler | null) => void;
|
|
35
|
+
declare const navigate: (path: string, params?: Record<string, any>) => void;
|
|
36
|
+
declare const safeNavigate: (name: string | undefined, params?: Record<string, any>) => void;
|
|
32
37
|
declare function onStateChange(): void;
|
|
33
38
|
|
|
34
39
|
type ScreenPosition = 'bottom-center' | 'bottom-left' | 'bottom-right';
|
|
@@ -46,7 +51,7 @@ type MicButtonProps = {
|
|
|
46
51
|
|
|
47
52
|
declare const MicButton: React.FC<MicButtonProps>;
|
|
48
53
|
|
|
49
|
-
declare function InitCuekit(apiKey: string
|
|
54
|
+
declare function InitCuekit(apiKey: string): void;
|
|
50
55
|
|
|
51
56
|
declare const useVoiceRecognition: (lang?: string) => {
|
|
52
57
|
isListening: boolean;
|
|
@@ -55,4 +60,4 @@ declare const useVoiceRecognition: (lang?: string) => {
|
|
|
55
60
|
speechText: string;
|
|
56
61
|
};
|
|
57
62
|
|
|
58
|
-
export { CuekitProvider, InitCuekit, MicButton, onStateChange, processVoice, useAudioController, useVoiceRecognition };
|
|
63
|
+
export { CuekitProvider, InitCuekit, MicButton, navigate, onStateChange, processVoice, safeNavigate, setNavigationHandler, setNavigator, useAudioController, useVoiceRecognition };
|