@revrag-ai/embed-react-native 1.0.10 → 1.0.12
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 +707 -253
- package/dist/commonjs/NativeEmbedReactNative.js.map +1 -0
- package/dist/commonjs/api/api.js.map +1 -0
- package/dist/commonjs/api/types/embed.api.types.js.map +1 -0
- package/dist/commonjs/components/Embed/EmbedAudioWave.js.map +1 -0
- package/dist/commonjs/components/Embed/EmbedButton.js +2 -0
- package/dist/commonjs/components/Embed/EmbedButton.js.map +1 -0
- package/dist/commonjs/components/Embed/EmbedVoice.js.map +1 -0
- package/dist/commonjs/components/styles/EmbedButton.style.js.map +1 -0
- package/dist/commonjs/events/embed.event.js.map +1 -0
- package/dist/commonjs/hooks/initialize.js +3 -24
- package/dist/commonjs/hooks/initialize.js.map +1 -0
- package/dist/commonjs/hooks/initialize.livekit.js.map +1 -0
- package/dist/commonjs/hooks/types/initialize.types.js.map +1 -0
- package/dist/commonjs/hooks/types/voiceAgent.types.js.map +1 -0
- package/dist/commonjs/hooks/voiceagent.js.map +1 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/index.types.js.map +1 -0
- package/dist/commonjs/store/store.key.js +0 -3
- package/dist/commonjs/store/store.key.js.map +1 -0
- package/dist/commonjs/utils/permision.js +29 -0
- package/dist/commonjs/utils/permision.js.map +1 -0
- package/dist/commonjs/utils/reanimated.helper.js +0 -1
- package/dist/commonjs/utils/reanimated.helper.js.map +1 -0
- package/dist/module/NativeEmbedReactNative.js.map +1 -0
- package/dist/module/api/api.js.map +1 -0
- package/dist/module/api/types/embed.api.types.js.map +1 -0
- package/dist/module/components/Embed/EmbedAudioWave.js.map +1 -0
- package/dist/module/components/Embed/EmbedButton.js +2 -0
- package/dist/module/components/Embed/EmbedButton.js.map +1 -0
- package/dist/module/components/Embed/EmbedVoice.js.map +1 -0
- package/dist/module/components/styles/EmbedButton.style.js.map +1 -0
- package/dist/module/events/embed.event.js.map +1 -0
- package/dist/module/hooks/initialize.js +2 -23
- package/dist/module/hooks/initialize.js.map +1 -0
- package/dist/module/hooks/initialize.livekit.js.map +1 -0
- package/dist/module/hooks/types/initialize.types.js.map +1 -0
- package/dist/module/hooks/types/voiceAgent.types.js.map +1 -0
- package/dist/module/hooks/voiceagent.js.map +1 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/index.types.js.map +1 -0
- package/dist/module/store/store.key.js +0 -3
- package/dist/module/store/store.key.js.map +1 -0
- package/dist/module/utils/permision.js +24 -0
- package/dist/module/utils/permision.js.map +1 -0
- package/dist/module/utils/reanimated.helper.js +0 -1
- package/dist/module/utils/reanimated.helper.js.map +1 -0
- package/dist/typescript/src/NativeEmbedReactNative.d.ts +7 -0
- package/dist/typescript/src/NativeEmbedReactNative.d.ts.map +1 -0
- package/dist/typescript/src/__tests__/index.test.d.ts +1 -0
- package/dist/typescript/src/__tests__/index.test.d.ts.map +1 -0
- package/dist/typescript/src/api/api.d.ts +54 -0
- package/dist/typescript/src/api/api.d.ts.map +1 -0
- package/dist/typescript/src/api/types/embed.api.types.d.ts +21 -0
- package/dist/typescript/src/api/types/embed.api.types.d.ts.map +1 -0
- package/dist/typescript/src/components/Embed/EmbedAudioWave.d.ts +7 -0
- package/dist/typescript/src/components/Embed/EmbedAudioWave.d.ts.map +1 -0
- package/dist/typescript/src/components/Embed/EmbedButton.d.ts +29 -0
- package/dist/typescript/src/components/Embed/EmbedButton.d.ts.map +1 -0
- package/dist/typescript/src/components/Embed/EmbedVoice.d.ts +16 -0
- package/dist/typescript/src/components/Embed/EmbedVoice.d.ts.map +1 -0
- package/dist/typescript/src/components/styles/EmbedButton.style.d.ts +99 -0
- package/dist/typescript/src/components/styles/EmbedButton.style.d.ts.map +1 -0
- package/dist/typescript/src/events/embed.event.d.ts +14 -0
- package/dist/typescript/src/events/embed.event.d.ts.map +1 -0
- package/dist/typescript/src/hooks/initialize.d.ts +3 -0
- package/dist/typescript/src/hooks/initialize.d.ts.map +1 -0
- package/dist/typescript/src/hooks/initialize.livekit.d.ts +4 -0
- package/dist/typescript/src/hooks/initialize.livekit.d.ts.map +1 -0
- package/dist/typescript/src/hooks/types/initialize.types.d.ts +5 -0
- package/dist/typescript/src/hooks/types/initialize.types.d.ts.map +1 -0
- package/dist/typescript/src/hooks/types/voiceAgent.types.d.ts +17 -0
- package/dist/typescript/src/hooks/types/voiceAgent.types.d.ts.map +1 -0
- package/dist/typescript/src/hooks/voiceagent.d.ts +3 -0
- package/dist/typescript/src/hooks/voiceagent.d.ts.map +1 -0
- package/dist/typescript/src/index.d.ts +12 -0
- package/dist/typescript/src/index.d.ts.map +1 -0
- package/dist/typescript/src/index.types.d.ts +58 -0
- package/dist/typescript/src/index.types.d.ts.map +1 -0
- package/dist/typescript/src/store/store.key.d.ts +4 -0
- package/dist/typescript/src/store/store.key.d.ts.map +1 -0
- package/dist/typescript/src/utils/permision.d.ts +2 -0
- package/dist/typescript/src/utils/permision.d.ts.map +1 -0
- package/dist/typescript/src/utils/reanimated.helper.d.ts +30 -0
- package/dist/typescript/src/utils/reanimated.helper.d.ts.map +1 -0
- package/package.json +10 -20
|
@@ -6,7 +6,6 @@ export const setAgentData = async (data, key = STORAGE_KEY) => {
|
|
|
6
6
|
try {
|
|
7
7
|
const jsonString = JSON.stringify(data);
|
|
8
8
|
await AsyncStorage.setItem(key, jsonString);
|
|
9
|
-
console.log('Data saved to storage successfully');
|
|
10
9
|
} catch (error) {
|
|
11
10
|
console.error('Storage save error:', error);
|
|
12
11
|
throw error; // Re-throw to allow caller to handle
|
|
@@ -16,7 +15,6 @@ export const getAgentData = async (key = STORAGE_KEY) => {
|
|
|
16
15
|
try {
|
|
17
16
|
const jsonString = await AsyncStorage.getItem(key);
|
|
18
17
|
if (!jsonString) {
|
|
19
|
-
console.log('No data stored');
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
20
|
const data = JSON.parse(jsonString);
|
|
@@ -29,7 +27,6 @@ export const getAgentData = async (key = STORAGE_KEY) => {
|
|
|
29
27
|
export const deleteFromDetail = async key => {
|
|
30
28
|
try {
|
|
31
29
|
await AsyncStorage.removeItem(key);
|
|
32
|
-
console.log('Storage data reset successfully');
|
|
33
30
|
} catch (error) {
|
|
34
31
|
console.error('Storage reset error:', error);
|
|
35
32
|
throw error; // Re-throw to allow caller to handle
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AsyncStorage","STORAGE_KEY","setAgentData","data","key","jsonString","JSON","stringify","setItem","error","console","getAgentData","getItem","parse","deleteFromDetail","removeItem"],"sourceRoot":"../../../src","sources":["store/store.key.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,2CAA2C;AAEpE,MAAMC,WAAW,GAAG,YAAY;AAEhC,OAAO,MAAMC,YAAY,GAAG,MAAAA,CAC1BC,IAAyB,EACzBC,GAAW,GAAGH,WAAW,KACtB;EACH,IAAI;IACF,MAAMI,UAAU,GAAGC,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC;IACvC,MAAMH,YAAY,CAACQ,OAAO,CAACJ,GAAG,EAAEC,UAAU,CAAC;EAC7C,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,qBAAqB,EAAEA,KAAK,CAAC;IAC3C,MAAMA,KAAK,CAAC,CAAC;EACf;AACF,CAAC;AAED,OAAO,MAAME,YAAY,GAAG,MAAAA,CAAOP,GAAW,GAAGH,WAAW,KAAK;EAC/D,IAAI;IACF,MAAMI,UAAU,GAAG,MAAML,YAAY,CAACY,OAAO,CAACR,GAAG,CAAC;IAClD,IAAI,CAACC,UAAU,EAAE;MACf,OAAO,IAAI;IACb;IACA,MAAMF,IAAI,GAAGG,IAAI,CAACO,KAAK,CAACR,UAAU,CAAC;IACnC,OAAOF,IAAI;EACb,CAAC,CAAC,OAAOM,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,sBAAsB,EAAEA,KAAK,CAAC;IAC5C,MAAMA,KAAK,CAAC,CAAC;EACf;AACF,CAAC;AAED,OAAO,MAAMK,gBAAgB,GAAG,MAAOV,GAAW,IAAK;EACrD,IAAI;IACF,MAAMJ,YAAY,CAACe,UAAU,CAACX,GAAG,CAAC;EACpC,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,sBAAsB,EAAEA,KAAK,CAAC;IAC5C,MAAMA,KAAK,CAAC,CAAC;EACf;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { PermissionsAndroid, Platform } from 'react-native';
|
|
4
|
+
export const checkPermissions = async () => {
|
|
5
|
+
try {
|
|
6
|
+
// Check for required permissions on Android
|
|
7
|
+
if (Platform.OS === 'android') {
|
|
8
|
+
const recordAudioPermission = PermissionsAndroid.PERMISSIONS.RECORD_AUDIO;
|
|
9
|
+
if (!recordAudioPermission) {
|
|
10
|
+
throw new Error('RECORD_AUDIO permission not available');
|
|
11
|
+
}
|
|
12
|
+
const permissions = [recordAudioPermission];
|
|
13
|
+
const results = await Promise.all(permissions.map(permission => PermissionsAndroid.request(permission)));
|
|
14
|
+
const allGranted = results.every(result => result === PermissionsAndroid.RESULTS.GRANTED);
|
|
15
|
+
if (!allGranted) {
|
|
16
|
+
throw new Error('Required permissions not granted');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
} catch (err) {
|
|
20
|
+
const errorMessage = err instanceof Error ? err.message : 'Failed to check permissions';
|
|
21
|
+
throw new Error(errorMessage);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=permision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PermissionsAndroid","Platform","checkPermissions","OS","recordAudioPermission","PERMISSIONS","RECORD_AUDIO","Error","permissions","results","Promise","all","map","permission","request","allGranted","every","result","RESULTS","GRANTED","err","errorMessage","message"],"sourceRoot":"../../../src","sources":["utils/permision.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAE3D,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAAA,KAA2B;EACzD,IAAI;IACF;IACA,IAAID,QAAQ,CAACE,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMC,qBAAqB,GAAGJ,kBAAkB,CAACK,WAAW,CAACC,YAAY;MACzE,IAAI,CAACF,qBAAqB,EAAE;QAC1B,MAAM,IAAIG,KAAK,CAAC,uCAAuC,CAAC;MAC1D;MAEA,MAAMC,WAAW,GAAG,CAACJ,qBAAqB,CAAC;MAE3C,MAAMK,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/BH,WAAW,CAACI,GAAG,CAAEC,UAAU,IAAKb,kBAAkB,CAACc,OAAO,CAACD,UAAU,CAAC,CACxE,CAAC;MAED,MAAME,UAAU,GAAGN,OAAO,CAACO,KAAK,CAC7BC,MAAM,IAAKA,MAAM,KAAKjB,kBAAkB,CAACkB,OAAO,CAACC,OACpD,CAAC;MAED,IAAI,CAACJ,UAAU,EAAE;QACf,MAAM,IAAIR,KAAK,CAAC,kCAAkC,CAAC;MACrD;IACF;EACF,CAAC,CAAC,OAAOa,GAAG,EAAE;IACZ,MAAMC,YAAY,GAChBD,GAAG,YAAYb,KAAK,GAAGa,GAAG,CAACE,OAAO,GAAG,6BAA6B;IACpE,MAAM,IAAIf,KAAK,CAACc,YAAY,CAAC;EAC/B;AACF,CAAC","ignoreList":[]}
|
|
@@ -33,7 +33,6 @@ export function getReanimatedAPI() {
|
|
|
33
33
|
Animated: reanimated.default,
|
|
34
34
|
isAvailable: true
|
|
35
35
|
};
|
|
36
|
-
console.log('✅ react-native-reanimated loaded successfully');
|
|
37
36
|
return reanimatedAPI;
|
|
38
37
|
} catch (error) {
|
|
39
38
|
console.warn('⚠️ react-native-reanimated is not properly installed or configured:', error);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reanimatedAPI","getReanimatedAPI","reanimated","require","makeMutable","Error","useSharedValue","useAnimatedStyle","withTiming","withSpring","withRepeat","withSequence","runOnJS","Easing","Animated","default","isAvailable","error","console","warn","View","value","args","length","fn","inOut","easing","ease","t","checkReanimatedSetup","api","showReanimatedSetupError"],"sourceRoot":"../../../src","sources":["utils/reanimated.helper.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAeE,IAAIA,aAA4B;;AAEhC;AACF;AACA;AACE,OAAO,SAASC,gBAAgBA,CAAA,EAAkB;EAChD,IAAID,aAAa,EAAE;IACjB,OAAOA,aAAa;EACtB;EAEA,IAAI;IACF,MAAME,UAAU,GAAGC,OAAO,CAAC,yBAAyB,CAAC;;IAErD;IACA,IAAI,CAACD,UAAU,CAACE,WAAW,EAAE;MAC3B,MAAM,IAAIC,KAAK,CACb,gFACF,CAAC;IACH;IAEAL,aAAa,GAAG;MACdM,cAAc,EAAEJ,UAAU,CAACI,cAAc;MACzCC,gBAAgB,EAAEL,UAAU,CAACK,gBAAgB;MAC7CC,UAAU,EAAEN,UAAU,CAACM,UAAU;MACjCC,UAAU,EAAEP,UAAU,CAACO,UAAU;MACjCC,UAAU,EAAER,UAAU,CAACQ,UAAU;MACjCC,YAAY,EAAET,UAAU,CAACS,YAAY;MACrCC,OAAO,EAAEV,UAAU,CAACU,OAAO;MAC3BC,MAAM,EAAEX,UAAU,CAACW,MAAM;MACzBC,QAAQ,EAAEZ,UAAU,CAACa,OAAO;MAC5BC,WAAW,EAAE;IACf,CAAC;IAED,OAAOhB,aAAa;EACtB,CAAC,CAAC,OAAOiB,KAAK,EAAE;IACdC,OAAO,CAACC,IAAI,CACV,qEAAqE,EACrEF,KACF,CAAC;IACDC,OAAO,CAACC,IAAI,CACV,wHACF,CAAC;;IAED;IACA,MAAM;MAAEC;IAAK,CAAC,GAAGjB,OAAO,CAAC,cAAc,CAAC;IAExCH,aAAa,GAAG;MACdM,cAAc,EAAGe,KAAU,KAAM;QAAEA;MAAM,CAAC,CAAC;MAC3Cd,gBAAgB,EAAEA,CAAA,MAAO,CAAC,CAAC,CAAC;MAC5BC,UAAU,EAAGa,KAAU,IAAKA,KAAK;MACjCZ,UAAU,EAAGY,KAAU,IAAKA,KAAK;MACjCX,UAAU,EAAGW,KAAU,IAAKA,KAAK;MACjCV,YAAY,EAAEA,CAAC,GAAGW,IAAW,KAAKA,IAAI,CAACA,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;MACvDX,OAAO,EAAGY,EAAO,IAAKA,EAAE;MACxBX,MAAM,EAAE;QACNY,KAAK,EAAGC,MAAW,IAAKA,MAAM;QAC9BC,IAAI,EAAGC,CAAS,IAAKA;MACvB,CAAC;MACDd,QAAQ,EAAEM,IAAI;MACdJ,WAAW,EAAE;IACf,CAAC;IAED,OAAOhB,aAAa;EACtB;AACF;;AAEA;AACF;AACA;AACE,OAAO,SAAS6B,oBAAoBA,CAAA,EAAY;EAC9C,MAAMC,GAAG,GAAG7B,gBAAgB,CAAC,CAAC;EAC9B,OAAO6B,GAAG,CAACd,WAAW;AACxB;;AAEA;AACF;AACA;AACE,OAAO,SAASe,wBAAwBA,CAAA,EAAS;EAC/Cb,OAAO,CAACD,KAAK,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeEmbedReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeEmbedReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC;;AAED,wBAA0E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/index.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ApiResponse, TokenDetails, UpdateDataRequest } from './types/embed.api.types';
|
|
2
|
+
/**
|
|
3
|
+
* APIService class that ensures proper initialization before API calls
|
|
4
|
+
*/
|
|
5
|
+
export declare class APIService {
|
|
6
|
+
private static instance;
|
|
7
|
+
private apiBaseUrl;
|
|
8
|
+
private isInitialized;
|
|
9
|
+
private constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Get singleton instance of APIService
|
|
12
|
+
*/
|
|
13
|
+
static getInstance(): APIService;
|
|
14
|
+
/**
|
|
15
|
+
* Initialize the API service with the base URL
|
|
16
|
+
*/
|
|
17
|
+
initialize(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure the service is initialized before making API calls
|
|
20
|
+
*/
|
|
21
|
+
private ensureInitialized;
|
|
22
|
+
/**
|
|
23
|
+
* Get headers with stored API key
|
|
24
|
+
*/
|
|
25
|
+
private getHeaders;
|
|
26
|
+
/**
|
|
27
|
+
* Register a new user/device on initialization
|
|
28
|
+
* @returns Promise with registration response
|
|
29
|
+
*/
|
|
30
|
+
registerOnInitialize(): Promise<ApiResponse<TokenDetails>>;
|
|
31
|
+
/**
|
|
32
|
+
* Update user data
|
|
33
|
+
* @param params Update parameters including userId and data to update
|
|
34
|
+
* @returns Promise with update response
|
|
35
|
+
*/
|
|
36
|
+
updateUserData(params: UpdateDataRequest): Promise<ApiResponse<void>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get token details for a user
|
|
39
|
+
* @param params Parameters including app_user_id and call_type
|
|
40
|
+
* @returns Promise with token details
|
|
41
|
+
*/
|
|
42
|
+
getTokenDetails(params: {
|
|
43
|
+
app_user_id: string;
|
|
44
|
+
call_type: string;
|
|
45
|
+
}): Promise<ApiResponse<TokenDetails>>;
|
|
46
|
+
}
|
|
47
|
+
export declare const initializeApi: () => Promise<void>;
|
|
48
|
+
export declare const registerOnInitialize: () => Promise<ApiResponse<TokenDetails>>;
|
|
49
|
+
export declare const updateUserData: (params: UpdateDataRequest) => Promise<ApiResponse<void>>;
|
|
50
|
+
export declare const getTokenDetails: (params: {
|
|
51
|
+
app_user_id: string;
|
|
52
|
+
call_type: string;
|
|
53
|
+
}) => Promise<ApiResponse<TokenDetails>>;
|
|
54
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5F;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA2B;IAClD,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,aAAa,CAAkB;IAEvC,OAAO;IAEP;;OAEG;WACW,WAAW,IAAI,UAAU;IAOvC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBxC;;OAEG;YACW,iBAAiB;IAM/B;;OAEG;YACW,UAAU;IAYxB;;;OAGG;IACU,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAyEvE;;;;OAIG;IACU,cAAc,CACzB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IA6E7B;;;;OAIG;IACU,eAAe,CAAC,MAAM,EAAE;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;CA2EvC;AAGD,eAAO,MAAM,aAAa,qBAGzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,0CAGhC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,QAAQ,iBAAiB,+BAG7D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,QAAQ;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,uCAGA,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type RegisterRequest = {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
embedUrl: string;
|
|
4
|
+
};
|
|
5
|
+
export type UpdateDataRequest = {
|
|
6
|
+
eventKey: string;
|
|
7
|
+
data: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
export type TokenDetails = {
|
|
10
|
+
token: string;
|
|
11
|
+
expiresAt: number;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
config: Record<string, any>;
|
|
14
|
+
server_url: string;
|
|
15
|
+
};
|
|
16
|
+
export type ApiResponse<T> = {
|
|
17
|
+
success: boolean;
|
|
18
|
+
data?: T;
|
|
19
|
+
error?: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=embed.api.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.api.types.d.ts","sourceRoot":"","sources":["../../../../../src/api/types/embed.api.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Room } from 'livekit-client';
|
|
2
|
+
interface WaveformVisualizerProps {
|
|
3
|
+
roomRef: React.RefObject<Room>;
|
|
4
|
+
}
|
|
5
|
+
export declare const WaveformVisualizer: ({ roomRef }: WaveformVisualizerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=EmbedAudioWave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbedAudioWave.d.ts","sourceRoot":"","sources":["../../../../../src/components/Embed/EmbedAudioWave.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,UAAU,uBAAuB;IAC/B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;CAChC;AAqHD,eAAO,MAAM,kBAAkB,GAAI,aAAa,uBAAuB,4CAsDtE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file OnwidButton.tsx
|
|
3
|
+
* @description A customizable floating action button component for React Native applications.
|
|
4
|
+
* This component provides a draggable, expandable button with animation support and gradient styling.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* OnwidButton Component
|
|
8
|
+
*
|
|
9
|
+
* A floating action button that can be dragged around the screen and expanded to show additional content.
|
|
10
|
+
* Features include:
|
|
11
|
+
* - Draggable functionality
|
|
12
|
+
* - Expandable menu
|
|
13
|
+
* - Animated transitions
|
|
14
|
+
* - Gradient background
|
|
15
|
+
* - Customizable styling
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <OnwidButton
|
|
21
|
+
* isOpen={false}
|
|
22
|
+
* onPress={(isOpen) => console.log('Button pressed:', isOpen)}
|
|
23
|
+
* menuComponent={<YourMenuComponent />}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function EmbedButton(): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
export default EmbedButton;
|
|
29
|
+
//# sourceMappingURL=EmbedButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbedButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Embed/EmbedButton.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA4EH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,mDA8c1B;AAGD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Room } from 'livekit-client';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
interface VoiceProps {
|
|
4
|
+
url: string;
|
|
5
|
+
token: string;
|
|
6
|
+
onDisconnected: (data: string) => void;
|
|
7
|
+
onConnected: (data: string) => void;
|
|
8
|
+
roomRef: RefObject<Room>;
|
|
9
|
+
}
|
|
10
|
+
export interface VoiceRef {
|
|
11
|
+
mute: () => void;
|
|
12
|
+
unmute: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Voice: (props: VoiceProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export default Voice;
|
|
16
|
+
//# sourceMappingURL=EmbedVoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbedVoice.d.ts","sourceRoot":"","sources":["../../../../../src/components/Embed/EmbedVoice.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEpE,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CAC1B;AASD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAUD,QAAA,MAAM,KAAK,GAAI,OAAO,UAAU,mDA6G/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type ViewStyle, type TextStyle, type ImageStyle } from 'react-native';
|
|
2
|
+
export declare const BUTTON_WIDTH: number;
|
|
3
|
+
export declare const EXPANDED_WIDTH: number;
|
|
4
|
+
export declare const BUTTON_HEIGHT: number;
|
|
5
|
+
type SpacingType = {
|
|
6
|
+
SMALL: number;
|
|
7
|
+
MEDIUM: number;
|
|
8
|
+
LARGE: number;
|
|
9
|
+
};
|
|
10
|
+
type CustomStyles = {
|
|
11
|
+
buttonWidth?: number;
|
|
12
|
+
buttonHeight?: number;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
borderRadius?: number;
|
|
15
|
+
marginBottom?: number;
|
|
16
|
+
spacing?: SpacingType;
|
|
17
|
+
};
|
|
18
|
+
export declare const createEmbedButtonStyles: (customStyles?: CustomStyles) => {
|
|
19
|
+
container: ViewStyle;
|
|
20
|
+
button: ViewStyle;
|
|
21
|
+
pressable: ViewStyle;
|
|
22
|
+
menu: ViewStyle;
|
|
23
|
+
menuLeft: ViewStyle;
|
|
24
|
+
menuRight: ViewStyle;
|
|
25
|
+
iconText: TextStyle;
|
|
26
|
+
buttonContent: ViewStyle;
|
|
27
|
+
iconImage: ImageStyle;
|
|
28
|
+
startCallButton: ViewStyle;
|
|
29
|
+
startCallText: TextStyle;
|
|
30
|
+
rowContainer: ViewStyle;
|
|
31
|
+
linearGradient: ViewStyle;
|
|
32
|
+
buttonContainer: ViewStyle;
|
|
33
|
+
endCallButton: ViewStyle;
|
|
34
|
+
muteButton: ViewStyle;
|
|
35
|
+
micIcon: {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
tintColor: string;
|
|
39
|
+
};
|
|
40
|
+
endCallIcon: {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
tintColor: string;
|
|
44
|
+
};
|
|
45
|
+
buttonImage: ImageStyle;
|
|
46
|
+
expandedContent: ViewStyle;
|
|
47
|
+
leftSection: ViewStyle;
|
|
48
|
+
centerSection: ViewStyle;
|
|
49
|
+
rightSection: ViewStyle;
|
|
50
|
+
agentInfoContainer: ViewStyle;
|
|
51
|
+
agentTextContainer: ViewStyle;
|
|
52
|
+
agentNameText: TextStyle;
|
|
53
|
+
statusText: TextStyle;
|
|
54
|
+
chip: ViewStyle;
|
|
55
|
+
chipGradient: ViewStyle;
|
|
56
|
+
chipText: TextStyle;
|
|
57
|
+
};
|
|
58
|
+
export declare const onwidButtonStyles: {
|
|
59
|
+
container: ViewStyle;
|
|
60
|
+
button: ViewStyle;
|
|
61
|
+
pressable: ViewStyle;
|
|
62
|
+
menu: ViewStyle;
|
|
63
|
+
menuLeft: ViewStyle;
|
|
64
|
+
menuRight: ViewStyle;
|
|
65
|
+
iconText: TextStyle;
|
|
66
|
+
buttonContent: ViewStyle;
|
|
67
|
+
iconImage: ImageStyle;
|
|
68
|
+
startCallButton: ViewStyle;
|
|
69
|
+
startCallText: TextStyle;
|
|
70
|
+
rowContainer: ViewStyle;
|
|
71
|
+
linearGradient: ViewStyle;
|
|
72
|
+
buttonContainer: ViewStyle;
|
|
73
|
+
endCallButton: ViewStyle;
|
|
74
|
+
muteButton: ViewStyle;
|
|
75
|
+
micIcon: {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
tintColor: string;
|
|
79
|
+
};
|
|
80
|
+
endCallIcon: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
tintColor: string;
|
|
84
|
+
};
|
|
85
|
+
buttonImage: ImageStyle;
|
|
86
|
+
expandedContent: ViewStyle;
|
|
87
|
+
leftSection: ViewStyle;
|
|
88
|
+
centerSection: ViewStyle;
|
|
89
|
+
rightSection: ViewStyle;
|
|
90
|
+
agentInfoContainer: ViewStyle;
|
|
91
|
+
agentTextContainer: ViewStyle;
|
|
92
|
+
agentNameText: TextStyle;
|
|
93
|
+
statusText: TextStyle;
|
|
94
|
+
chip: ViewStyle;
|
|
95
|
+
chipGradient: ViewStyle;
|
|
96
|
+
chipText: TextStyle;
|
|
97
|
+
};
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=EmbedButton.style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbedButton.style.d.ts","sourceRoot":"","sources":["../../../../../src/components/styles/EmbedButton.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AA6BtB,eAAO,MAAM,YAAY,QAA0B,CAAC;AACpD,eAAO,MAAM,cAAc,QAA4B,CAAC;AACxD,eAAO,MAAM,aAAa,QAA2B,CAAC;AAEtD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,eAAe,YAAY;eAuB1D,SAAS;YAOT,SAAS;eAST,SAAS;UAOT,SAAS;cAIT,SAAS;eAIT,SAAS;cAIT,SAAS;mBAKT,SAAS;eAUT,UAAU;qBAUV,SAAS;mBAKT,SAAS;kBAQT,SAAS;oBAMT,SAAS;qBAKT,SAAS;mBAMT,SAAS;gBAOT,SAAS;;;;;;;;;;;iBAeT,UAAU;qBAQV,SAAS;iBAGT,SAAS;mBAIT,SAAS;kBAIT,SAAS;wBAMT,SAAS;wBAKT,SAAS;mBAMT,SAAS;gBAMT,SAAS;UAaT,SAAS;kBAQT,SAAS;cAKT,SAAS;CAEjB,CAAC;AAGF,eAAO,MAAM,iBAAiB;eAzLrB,SAAS;YAOT,SAAS;eAST,SAAS;UAOT,SAAS;cAIT,SAAS;eAIT,SAAS;cAIT,SAAS;mBAKT,SAAS;eAUT,UAAU;qBAUV,SAAS;mBAKT,SAAS;kBAQT,SAAS;oBAMT,SAAS;qBAKT,SAAS;mBAMT,SAAS;gBAOT,SAAS;;;;;;;;;;;iBAeT,UAAU;qBAQV,SAAS;iBAGT,SAAS;mBAIT,SAAS;kBAIT,SAAS;wBAMT,SAAS;wBAKT,SAAS;mBAMT,SAAS;gBAMT,SAAS;UAaT,SAAS;kBAQT,SAAS;cAKT,SAAS;CAKwC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type EventCallback = (data: any) => void;
|
|
2
|
+
export declare enum EventKeys {
|
|
3
|
+
USER_DATA = "user_data",
|
|
4
|
+
SCREEN_STATE = "state_data"
|
|
5
|
+
}
|
|
6
|
+
declare class Embed {
|
|
7
|
+
private events;
|
|
8
|
+
private ensureDefaultListener;
|
|
9
|
+
Event(eventKey: string, data: any): Promise<void>;
|
|
10
|
+
on(eventKey: EventKeys, callback: EventCallback): void;
|
|
11
|
+
}
|
|
12
|
+
declare const embed: Embed;
|
|
13
|
+
export default embed;
|
|
14
|
+
//# sourceMappingURL=embed.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.event.d.ts","sourceRoot":"","sources":["../../../../src/events/embed.event.ts"],"names":[],"mappings":"AAGA,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAGzC,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,YAAY,eAAe;CAC5B;AAED,cAAM,KAAK;IACT,OAAO,CAAC,MAAM,CAAgD;IAG9D,OAAO,CAAC,qBAAqB;IAUvB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IA8CvC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;CAMhD;AAED,QAAA,MAAM,KAAK,OAAc,CAAC;AAC1B,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/hooks/initialize.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,GACT,EAAE,kBAAkB,GAAG,IAAI,CAqD3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.livekit.d.ts","sourceRoot":"","sources":["../../../../src/hooks/initialize.livekit.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,QAAA,MAAM,aAAa,wBAAkB,CAAC;AAEtC,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/types/initialize.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConnectionState, Room } from 'livekit-client';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
export type UseVoiceAgentReturn = {
|
|
4
|
+
initializeVoiceAgent: () => Promise<void>;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
tokenDetails: any;
|
|
8
|
+
endCall: () => Promise<void>;
|
|
9
|
+
room: Room;
|
|
10
|
+
roomRef: RefObject<Room>;
|
|
11
|
+
isMicMuted: boolean;
|
|
12
|
+
muteMic: () => void;
|
|
13
|
+
unmuteMic: () => void;
|
|
14
|
+
connectionState: ConnectionState;
|
|
15
|
+
cleanup: () => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=voiceAgent.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceAgent.types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/types/voiceAgent.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,GAAG,CAAC;IAClB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceagent.d.ts","sourceRoot":"","sources":["../../../../src/hooks/voiceagent.ts"],"names":[],"mappings":"AAUE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAoEpE,eAAO,MAAM,aAAa,QAAO,mBAwThC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmbedButton } from './components/Embed/EmbedButton';
|
|
2
|
+
import { useInitialize } from './hooks/initialize';
|
|
3
|
+
import Embed, { EventKeys } from './events/embed.event';
|
|
4
|
+
import type { RegisterRequest } from './api/types/embed.api.types';
|
|
5
|
+
import type { UpdateDataRequest } from './api/types/embed.api.types';
|
|
6
|
+
import type { TokenDetails } from './api/types/embed.api.types';
|
|
7
|
+
import type { UseInitializeProps } from './hooks/types/initialize.types';
|
|
8
|
+
import type { UseVoiceAgentReturn } from './hooks/types/voiceAgent.types';
|
|
9
|
+
import type { ApiResponse } from './api/types/embed.api.types';
|
|
10
|
+
export { EmbedButton, useInitialize, Embed, EventKeys as EmbedEventKeys };
|
|
11
|
+
export type { UseInitializeProps, UseVoiceAgentReturn, ApiResponse, RegisterRequest, TokenDetails, UpdateDataRequest };
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,IAAI,cAAc,EAAE,CAAC;AAE1E,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.d.ts
|
|
3
|
+
* @description TypeScript declarations for the Onwid React Native library.
|
|
4
|
+
*/
|
|
5
|
+
import { ConnectionState, Room } from 'livekit-client';
|
|
6
|
+
import { type RefObject } from 'react';
|
|
7
|
+
export declare function OnwidButton(): JSX.Element;
|
|
8
|
+
export interface UseInitializeProps {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
embedUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface UseVoiceAgentReturn {
|
|
13
|
+
initializeVoiceAgent: () => Promise<void>;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
error: string | null;
|
|
16
|
+
tokenDetails: any;
|
|
17
|
+
endCall: () => Promise<void>;
|
|
18
|
+
room: Room;
|
|
19
|
+
roomRef: RefObject<Room>;
|
|
20
|
+
isMicMuted: boolean;
|
|
21
|
+
muteMic: () => void;
|
|
22
|
+
unmuteMic: () => void;
|
|
23
|
+
connectionState: ConnectionState;
|
|
24
|
+
cleanup: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const useInitialize: (props: UseInitializeProps) => void;
|
|
27
|
+
export declare const useVoiceAgent: () => UseVoiceAgentReturn;
|
|
28
|
+
export interface ApiResponse<T> {
|
|
29
|
+
success: boolean;
|
|
30
|
+
data?: T;
|
|
31
|
+
error?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RegisterRequest {
|
|
34
|
+
apiKey: string;
|
|
35
|
+
embedUrl: string;
|
|
36
|
+
}
|
|
37
|
+
export interface TokenDetails {
|
|
38
|
+
token: string;
|
|
39
|
+
expiresAt: number;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
config: Record<string, any>;
|
|
42
|
+
server_url: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UpdateDataRequest {
|
|
45
|
+
eventKey: string;
|
|
46
|
+
data: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
export declare enum EventKeys {
|
|
49
|
+
USER_DATA = "user_data",
|
|
50
|
+
SCREEN_STATE = "state_data"
|
|
51
|
+
}
|
|
52
|
+
export declare class OnWid {
|
|
53
|
+
Event(eventKey: string, data: any): Promise<void>;
|
|
54
|
+
on(eventKey: EventKeys, callback: (data: any) => void): void;
|
|
55
|
+
}
|
|
56
|
+
export declare const onwid: OnWid;
|
|
57
|
+
export declare const registerAgent: any;
|
|
58
|
+
//# sourceMappingURL=index.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../../src/index.types.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC;AAGnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,GAAG,CAAC;IAClB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAGD,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AACxE,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG9D,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAGD,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,YAAY,eAAe;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IACjD,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAC7D;AAED,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,EAAE,KAAK,CAAC;AAClC,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,GAAG,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const setAgentData: (data: Record<string, any>, key?: string) => Promise<void>;
|
|
2
|
+
export declare const getAgentData: (key?: string) => Promise<any>;
|
|
3
|
+
export declare const deleteFromDetail: (key: string) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=store.key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.key.d.ts","sourceRoot":"","sources":["../../../../src/store/store.key.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,MAAK,MAAoB,kBAS1B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,MAAK,MAAoB,iBAY3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,kBAOjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permision.d.ts","sourceRoot":"","sources":["../../../../src/utils/permision.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,IAAI,CA4BrD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file reanimatedHelpers.ts
|
|
3
|
+
* @description Utility functions to handle react-native-reanimated configuration and provide fallbacks
|
|
4
|
+
*/
|
|
5
|
+
interface ReanimatedAPI {
|
|
6
|
+
useSharedValue: any;
|
|
7
|
+
useAnimatedStyle: any;
|
|
8
|
+
withTiming: any;
|
|
9
|
+
withSpring: any;
|
|
10
|
+
withRepeat: any;
|
|
11
|
+
withSequence: any;
|
|
12
|
+
runOnJS: any;
|
|
13
|
+
Easing: any;
|
|
14
|
+
Animated: any;
|
|
15
|
+
isAvailable: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Safely loads react-native-reanimated and provides fallbacks if not available
|
|
19
|
+
*/
|
|
20
|
+
export declare function getReanimatedAPI(): ReanimatedAPI;
|
|
21
|
+
/**
|
|
22
|
+
* Check if react-native-reanimated is properly configured
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkReanimatedSetup(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Display a helpful error message if reanimated is not configured
|
|
27
|
+
*/
|
|
28
|
+
export declare function showReanimatedSetupError(): void;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=reanimated.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reanimated.helper.d.ts","sourceRoot":"","sources":["../../../../src/utils/reanimated.helper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,aAAa;IACnB,cAAc,EAAE,GAAG,CAAC;IACpB,gBAAgB,EAAE,GAAG,CAAC;IACtB,UAAU,EAAE,GAAG,CAAC;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAID;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CA2DhD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAe/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revrag-ai/embed-react-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"description": "A powerful React Native library for integrating AI-powered voice agents into mobile applications. Features real-time voice communication, intelligent speech processing, customizable UI components, and comprehensive event handling for building conversational AI experiences.",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -24,27 +24,17 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
|
-
"android",
|
|
28
|
-
"
|
|
27
|
+
"android/build.gradle",
|
|
28
|
+
"android/CMakeLists.txt",
|
|
29
|
+
"android/cpp-adapter.cpp",
|
|
30
|
+
"android/gradle.properties",
|
|
31
|
+
"android/generated",
|
|
32
|
+
"ios/*.h",
|
|
33
|
+
"ios/*.mm",
|
|
34
|
+
"ios/generated",
|
|
29
35
|
"cpp",
|
|
30
|
-
"assets",
|
|
31
|
-
"scripts",
|
|
32
36
|
"*.podspec",
|
|
33
|
-
"react-native.config.js"
|
|
34
|
-
"!dist/**/*.js.map",
|
|
35
|
-
"!dist/**/*.test.*",
|
|
36
|
-
"!dist/**/*.spec.*",
|
|
37
|
-
"!ios/build",
|
|
38
|
-
"!android/build",
|
|
39
|
-
"!android/gradle",
|
|
40
|
-
"!android/gradlew",
|
|
41
|
-
"!android/gradlew.bat",
|
|
42
|
-
"!android/local.properties",
|
|
43
|
-
"!**/__tests__",
|
|
44
|
-
"!**/__fixtures__",
|
|
45
|
-
"!**/__mocks__",
|
|
46
|
-
"!**/.*",
|
|
47
|
-
"!src"
|
|
37
|
+
"react-native.config.js"
|
|
48
38
|
],
|
|
49
39
|
"scripts": {
|
|
50
40
|
"example": "yarn workspace embed-react-native-example",
|