@revrag-ai/embed-react-native 1.0.6 → 1.0.8

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 (91) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +253 -274
  3. package/android/CMakeLists.txt +15 -0
  4. package/android/build.gradle +77 -25
  5. package/android/cpp-adapter.cpp +8 -0
  6. package/android/generated/java/com/revragai/embedreactnative/NativeEmbedReactNativeSpec.java +37 -0
  7. package/android/generated/jni/CMakeLists.txt +49 -0
  8. package/android/generated/jni/RNEmbedReactNativeSpec-generated.cpp +32 -0
  9. package/android/generated/jni/RNEmbedReactNativeSpec.h +31 -0
  10. package/android/generated/jni/react/renderer/components/RNEmbedReactNativeSpec/RNEmbedReactNativeSpecJSI-generated.cpp +28 -0
  11. package/android/generated/jni/react/renderer/components/RNEmbedReactNativeSpec/RNEmbedReactNativeSpecJSI.h +67 -0
  12. package/android/gradle.properties +5 -5
  13. package/cpp/revrag-ai-embed-react-native.cpp +7 -0
  14. package/cpp/revrag-ai-embed-react-native.h +8 -0
  15. package/ios/EmbedReactNative.h +9 -0
  16. package/ios/{Onwid.mm → EmbedReactNative.mm} +4 -4
  17. package/ios/generated/RNEmbedReactNativeSpec/RNEmbedReactNativeSpec-generated.mm +29 -0
  18. package/ios/generated/RNEmbedReactNativeSpec/RNEmbedReactNativeSpec.h +50 -0
  19. package/ios/generated/RNEmbedReactNativeSpecJSI-generated.cpp +28 -0
  20. package/ios/generated/RNEmbedReactNativeSpecJSI.h +67 -0
  21. package/lib/commonjs/NativeEmbedReactNative.js +9 -0
  22. package/{dist/commonjs/onwidApi → lib/commonjs/api}/api.js +86 -15
  23. package/lib/commonjs/api/types/embed.api.types.js +2 -0
  24. package/{dist/module/component/audiowave.js → lib/commonjs/components/Embed/EmbedAudioWave.js} +21 -17
  25. package/{dist/module/component/OnwidButton.js → lib/commonjs/components/Embed/EmbedButton.js} +65 -61
  26. package/{dist/module/component/voice.js → lib/commonjs/components/Embed/EmbedVoice.js} +18 -14
  27. package/{dist/commonjs/style/onwidButton.style.js → lib/commonjs/components/styles/EmbedButton.style.js} +14 -9
  28. package/{dist/module/Event/onwid.js → lib/commonjs/events/embed.event.js} +14 -10
  29. package/{dist → lib}/commonjs/hooks/initialize.js +22 -22
  30. package/{dist/commonjs/hooks/initializelivekit.js → lib/commonjs/hooks/initialize.livekit.js} +8 -5
  31. package/lib/commonjs/hooks/types/voiceAgent.types.js +6 -0
  32. package/{dist/module/hooks/voiceAgent.js → lib/commonjs/hooks/voiceagent.js} +36 -31
  33. package/lib/commonjs/index.js +34 -0
  34. package/{dist/module/index.d.js → lib/commonjs/index.types.js} +7 -7
  35. package/lib/commonjs/store/store.key.js +46 -0
  36. package/{dist/module/utils/reanimatedHelpers.js → lib/commonjs/utils/reanimated.helper.js} +23 -17
  37. package/lib/module/NativeEmbedReactNative.js +5 -0
  38. package/{dist/module/onwidApi → lib/module/api}/api.js +69 -6
  39. package/lib/module/api/types/embed.api.types.js +2 -0
  40. package/{dist/commonjs/component/audiowave.js → lib/module/components/Embed/EmbedAudioWave.js} +2 -3
  41. package/{dist/commonjs/component/OnwidButton.js → lib/module/components/Embed/EmbedButton.js} +10 -11
  42. package/{dist/commonjs/component/voice.js → lib/module/components/Embed/EmbedVoice.js} +1 -1
  43. package/{dist/module/style/onwidButton.style.js → lib/module/components/styles/EmbedButton.style.js} +3 -3
  44. package/{dist/commonjs/Event/onwid.js → lib/module/events/embed.event.js} +6 -6
  45. package/{dist → lib}/module/hooks/initialize.js +7 -13
  46. package/{dist/module/hooks/initializelivekit.js → lib/module/hooks/initialize.livekit.js} +1 -1
  47. package/{dist/commonjs/hooks/voiceAgent.js → lib/module/hooks/voiceagent.js} +4 -4
  48. package/lib/module/index.js +7 -0
  49. package/{dist/commonjs/index.d.js → lib/module/index.types.js} +2 -1
  50. package/{dist/commonjs/utils/reanimatedHelpers.js → lib/module/utils/reanimated.helper.js} +14 -14
  51. package/lib/typescript/module/package.json +1 -0
  52. package/package.json +71 -35
  53. package/react-native.config.js +8 -14
  54. package/revrag-ai-embed-react-native.podspec +41 -0
  55. package/Onwid.podspec +0 -20
  56. package/dist/commonjs/NativeOnwid.js +0 -5
  57. package/dist/commonjs/button.json +0 -1
  58. package/dist/commonjs/index.js +0 -34
  59. package/dist/commonjs/onwidApi/api.types.js +0 -2
  60. package/dist/commonjs/utils/utils.js +0 -2
  61. package/dist/module/NativeOnwid.js +0 -5
  62. package/dist/module/button.json +0 -1
  63. package/dist/module/hooks/voiceAgent.types.js +0 -4
  64. package/dist/module/index.js +0 -34
  65. package/dist/module/onwidApi/api.types.js +0 -2
  66. package/dist/module/store.key.js +0 -38
  67. package/dist/module/utils/utils.js +0 -2
  68. package/dist/typescript/Event/onwid.d.ts +0 -14
  69. package/dist/typescript/NativeOnwid.d.ts +0 -7
  70. package/dist/typescript/component/OnwidButton.d.ts +0 -29
  71. package/dist/typescript/component/audiowave.d.ts +0 -7
  72. package/dist/typescript/component/voice.d.ts +0 -16
  73. package/dist/typescript/hooks/initialize.d.ts +0 -3
  74. package/dist/typescript/hooks/initialize.types.d.ts +0 -6
  75. package/dist/typescript/hooks/initializelivekit.d.ts +0 -4
  76. package/dist/typescript/hooks/voiceAgent.d.ts +0 -3
  77. package/dist/typescript/hooks/voiceAgent.types.d.ts +0 -17
  78. package/dist/typescript/index.d.ts +0 -27
  79. package/dist/typescript/onwidApi/api.d.ts +0 -54
  80. package/dist/typescript/onwidApi/api.types.d.ts +0 -22
  81. package/dist/typescript/store.key.d.ts +0 -4
  82. package/dist/typescript/style/onwidButton.style.d.ts +0 -99
  83. package/dist/typescript/utils/reanimatedHelpers.d.ts +0 -30
  84. package/dist/typescript/utils/utils.d.ts +0 -1
  85. package/ios/Onwid.h +0 -5
  86. package/scripts/verify-setup.js +0 -90
  87. /package/{dist/commonjs/hooks → lib/commonjs/hooks/types}/initialize.types.js +0 -0
  88. /package/{dist/module/hooks → lib/module/hooks/types}/initialize.types.js +0 -0
  89. /package/{dist/commonjs/hooks → lib/module/hooks/types}/voiceAgent.types.js +0 -0
  90. /package/{dist/commonjs → lib/module/store}/store.key.js +0 -0
  91. /package/{dist → lib/typescript}/commonjs/package.json +0 -0
@@ -1,54 +0,0 @@
1
- import type { ApiResponse, TokenDetails, UpdateDataRequest } from './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
@@ -1,22 +0,0 @@
1
- export type RegisterRequest = {
2
- apiKey: string;
3
- onwidUrl: string;
4
- metadata?: Record<string, any>;
5
- };
6
- export type UpdateDataRequest = {
7
- eventKey: string;
8
- data: Record<string, any>;
9
- };
10
- export type TokenDetails = {
11
- token: string;
12
- expiresAt: number;
13
- apiKey: string;
14
- config: Record<string, any>;
15
- server_url: string;
16
- };
17
- export type ApiResponse<T> = {
18
- success: boolean;
19
- data?: T;
20
- error?: string;
21
- };
22
- //# sourceMappingURL=api.types.d.ts.map
@@ -1,4 +0,0 @@
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
@@ -1,99 +0,0 @@
1
- import { ViewStyle, TextStyle, 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 createOnwidButtonStyles: (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=onwidButton.style.d.ts.map
@@ -1,30 +0,0 @@
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=reanimatedHelpers.d.ts.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=utils.d.ts.map
package/ios/Onwid.h DELETED
@@ -1,5 +0,0 @@
1
- #import <OnwidSpec/OnwidSpec.h>
2
-
3
- @interface Onwid : NSObject <NativeOnwidSpec>
4
-
5
- @end
@@ -1,90 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Onwid Setup Verification Script
5
- * Run this script to verify that all dependencies are properly installed and configured.
6
- */
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- console.log('🔍 Verifying Onwid setup...\n');
12
-
13
- let hasErrors = false;
14
-
15
- // Check if react-native-reanimated is installed
16
- try {
17
- const packageJson = require(path.join(process.cwd(), 'package.json'));
18
- const dependencies = { ...packageJson.dependencies, ...packageJson.devDependencies };
19
-
20
- if (dependencies['react-native-reanimated']) {
21
- console.log('✅ react-native-reanimated is installed:', dependencies['react-native-reanimated']);
22
- } else {
23
- console.log('❌ react-native-reanimated is not installed');
24
- console.log(' Fix: npm install react-native-reanimated');
25
- hasErrors = true;
26
- }
27
- } catch (error) {
28
- console.log('❌ Cannot read package.json');
29
- hasErrors = true;
30
- }
31
-
32
- // Check babel.config.js
33
- const babelConfigPath = path.join(process.cwd(), 'babel.config.js');
34
- if (fs.existsSync(babelConfigPath)) {
35
- try {
36
- const babelConfig = fs.readFileSync(babelConfigPath, 'utf8');
37
- if (babelConfig.includes('react-native-reanimated/plugin')) {
38
- console.log('✅ babel.config.js includes react-native-reanimated plugin');
39
- } else {
40
- console.log('❌ babel.config.js missing react-native-reanimated plugin');
41
- console.log(' Fix: Add "react-native-reanimated/plugin" to your plugins array');
42
- hasErrors = true;
43
- }
44
- } catch (error) {
45
- console.log('❌ Cannot read babel.config.js');
46
- hasErrors = true;
47
- }
48
- } else {
49
- console.log('❌ babel.config.js not found');
50
- hasErrors = true;
51
- }
52
-
53
- // Check other required dependencies
54
- const requiredDeps = [
55
- '@livekit/react-native',
56
- '@livekit/react-native-webrtc',
57
- '@react-native-async-storage/async-storage',
58
- 'lottie-react-native',
59
- 'react-native-gesture-handler',
60
- 'react-native-linear-gradient',
61
- 'react-native-safe-area-context'
62
- ];
63
-
64
- console.log('\n📦 Checking other required dependencies:');
65
- try {
66
- const packageJson = require(path.join(process.cwd(), 'package.json'));
67
- const allDeps = { ...packageJson.dependencies, ...packageJson.devDependencies, ...packageJson.peerDependencies };
68
-
69
- requiredDeps.forEach(dep => {
70
- if (allDeps[dep]) {
71
- console.log(`✅ ${dep}: ${allDeps[dep]}`);
72
- } else {
73
- console.log(`⚠️ ${dep}: Not found (should be installed as peer dependency)`);
74
- }
75
- });
76
- } catch (error) {
77
- console.log('❌ Cannot check dependencies');
78
- }
79
-
80
- // Final result
81
- console.log('\n' + '='.repeat(50));
82
- if (hasErrors) {
83
- console.log('❌ Setup has issues. Please fix the errors above.');
84
- console.log('\n📚 For detailed setup instructions, visit:');
85
- console.log(' https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started');
86
- process.exit(1);
87
- } else {
88
- console.log('✅ Setup verification passed!');
89
- console.log('🚀 You should be able to use @revrag-ai/embed-react-native without issues.');
90
- }
File without changes