@onairos/react-native 3.0.17 → 3.0.19

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 (58) hide show
  1. package/lib/commonjs/assets/images/farcaster.png +0 -0
  2. package/lib/commonjs/assets/images/instagram.png +0 -0
  3. package/lib/commonjs/assets/images/linkedin.png +0 -0
  4. package/lib/commonjs/assets/images/pinterest.png +0 -0
  5. package/lib/commonjs/assets/images/reddit.png +0 -0
  6. package/lib/commonjs/assets/images/swerv_logo.png +0 -0
  7. package/lib/commonjs/assets/images/twitter.jpg +0 -0
  8. package/lib/commonjs/assets/images/youtube.png +0 -0
  9. package/lib/commonjs/components/Overlay.js +13 -0
  10. package/lib/commonjs/components/Overlay.js.map +1 -1
  11. package/lib/commonjs/components/PinInput.js +70 -11
  12. package/lib/commonjs/components/PinInput.js.map +1 -1
  13. package/lib/commonjs/components/TrainingModal.js +91 -14
  14. package/lib/commonjs/components/TrainingModal.js.map +1 -1
  15. package/lib/commonjs/components/UniversalOnboarding.js +19 -7
  16. package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
  17. package/lib/module/assets/images/farcaster.png +0 -0
  18. package/lib/module/assets/images/instagram.png +0 -0
  19. package/lib/module/assets/images/linkedin.png +0 -0
  20. package/lib/module/assets/images/pinterest.png +0 -0
  21. package/lib/module/assets/images/reddit.png +0 -0
  22. package/lib/module/assets/images/swerv_logo.png +0 -0
  23. package/lib/module/assets/images/twitter.jpg +0 -0
  24. package/lib/module/assets/images/youtube.png +0 -0
  25. package/lib/module/components/Overlay.js +13 -0
  26. package/lib/module/components/Overlay.js.map +1 -1
  27. package/lib/module/components/PinInput.js +71 -12
  28. package/lib/module/components/PinInput.js.map +1 -1
  29. package/lib/module/components/TrainingModal.js +92 -15
  30. package/lib/module/components/TrainingModal.js.map +1 -1
  31. package/lib/module/components/UniversalOnboarding.js +19 -7
  32. package/lib/module/components/UniversalOnboarding.js.map +1 -1
  33. package/lib/typescript/components/Overlay.d.ts.map +1 -1
  34. package/lib/typescript/components/PinInput.d.ts.map +1 -1
  35. package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
  36. package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
  37. package/lib/typescript/types/index.d.ts +5 -0
  38. package/lib/typescript/types/index.d.ts.map +1 -1
  39. package/lib/typescript/types.d.ts +7 -7
  40. package/lib/typescript/types.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/assets/images/farcaster.png +0 -0
  43. package/src/assets/images/instagram.png +0 -0
  44. package/src/assets/images/linkedin.png +0 -0
  45. package/src/assets/images/pinterest.png +0 -0
  46. package/src/assets/images/reddit.png +0 -0
  47. package/src/assets/images/swerv_logo.png +0 -0
  48. package/src/assets/images/twitter.jpg +0 -0
  49. package/src/assets/images/youtube.png +0 -0
  50. package/src/components/Overlay.tsx +4 -0
  51. package/src/components/PinInput.tsx +250 -189
  52. package/src/components/TrainingModal.tsx +222 -132
  53. package/src/components/UniversalOnboarding.tsx +8 -5
  54. package/src/types/index.ts +150 -145
  55. package/src/types.ts +149 -149
  56. package/lib/commonjs/components/Overlay.tsx.new +0 -516
  57. package/lib/module/components/Overlay.tsx.new +0 -516
  58. package/src/components/Overlay.tsx.new +0 -516
@@ -1,132 +1,222 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- TouchableOpacity,
7
- ActivityIndicator,
8
- } from 'react-native';
9
- import Icon from 'react-native-vector-icons/MaterialIcons';
10
- import { COLORS } from '../constants';
11
- import type { TrainingModalProps } from '../types';
12
-
13
- export const TrainingModal: React.FC<TrainingModalProps> = ({
14
- progress,
15
- eta,
16
- onCancel,
17
- }) => {
18
- const progressPercentage = Math.round(progress * 100);
19
-
20
- return (
21
- <View style={styles.container}>
22
- <View style={styles.content}>
23
- <Icon name="auto_awesome" size={48} color={COLORS.primary} />
24
-
25
- <Text style={styles.title}>Training Your AI Model</Text>
26
- <Text style={styles.subtitle}>
27
- We're analyzing your social media data to create your personalized AI model
28
- </Text>
29
-
30
- <View style={styles.progressContainer}>
31
- <View style={styles.progressBar}>
32
- <View
33
- style={[
34
- styles.progressFill,
35
- { width: `${progressPercentage}%` },
36
- ]}
37
- />
38
- </View>
39
- <Text style={styles.progressText}>{progressPercentage}%</Text>
40
- </View>
41
-
42
- <Text style={styles.etaText}>Estimated time remaining: {eta}</Text>
43
-
44
- <View style={styles.loadingContainer}>
45
- <ActivityIndicator size="small" color={COLORS.primary} />
46
- <Text style={styles.loadingText}>Processing your data...</Text>
47
- </View>
48
-
49
- <TouchableOpacity
50
- style={styles.cancelButton}
51
- onPress={onCancel}
52
- >
53
- <Text style={styles.cancelButtonText}>Cancel</Text>
54
- </TouchableOpacity>
55
- </View>
56
- </View>
57
- );
58
- };
59
-
60
- const styles = StyleSheet.create({
61
- container: {
62
- flex: 1,
63
- justifyContent: 'center',
64
- alignItems: 'center',
65
- padding: 24,
66
- },
67
- content: {
68
- width: '100%',
69
- alignItems: 'center',
70
- },
71
- title: {
72
- fontSize: 24,
73
- fontWeight: '600',
74
- marginTop: 24,
75
- marginBottom: 8,
76
- color: COLORS.text.primary,
77
- textAlign: 'center',
78
- },
79
- subtitle: {
80
- fontSize: 16,
81
- color: COLORS.text.secondary,
82
- textAlign: 'center',
83
- marginBottom: 32,
84
- },
85
- progressContainer: {
86
- width: '100%',
87
- marginBottom: 16,
88
- },
89
- progressBar: {
90
- height: 8,
91
- backgroundColor: COLORS.border,
92
- borderRadius: 4,
93
- overflow: 'hidden',
94
- },
95
- progressFill: {
96
- height: '100%',
97
- backgroundColor: COLORS.primary,
98
- borderRadius: 4,
99
- },
100
- progressText: {
101
- fontSize: 14,
102
- color: COLORS.text.secondary,
103
- textAlign: 'center',
104
- marginTop: 8,
105
- },
106
- etaText: {
107
- fontSize: 14,
108
- color: COLORS.text.secondary,
109
- marginBottom: 24,
110
- },
111
- loadingContainer: {
112
- flexDirection: 'row',
113
- alignItems: 'center',
114
- marginBottom: 32,
115
- },
116
- loadingText: {
117
- fontSize: 14,
118
- color: COLORS.text.secondary,
119
- marginLeft: 8,
120
- },
121
- cancelButton: {
122
- paddingVertical: 12,
123
- paddingHorizontal: 24,
124
- borderRadius: 8,
125
- borderWidth: 1,
126
- borderColor: COLORS.border,
127
- },
128
- cancelButtonText: {
129
- fontSize: 16,
130
- color: COLORS.text.secondary,
131
- },
132
- });
1
+ import React from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ ActivityIndicator,
8
+ Dimensions,
9
+ Modal,
10
+ Animated,
11
+ TouchableWithoutFeedback,
12
+ SafeAreaView,
13
+ } from 'react-native';
14
+ import Icon from 'react-native-vector-icons/MaterialIcons';
15
+ import { COLORS } from '../constants';
16
+ import type { TrainingModalProps } from '../types';
17
+
18
+ const { width, height } = Dimensions.get('window');
19
+
20
+ export const TrainingModal: React.FC<TrainingModalProps> = ({
21
+ visible,
22
+ progress,
23
+ eta,
24
+ onCancel,
25
+ onComplete,
26
+ modelKey,
27
+ username,
28
+ }) => {
29
+ const progressPercentage = Math.round(progress * 100);
30
+
31
+ return (
32
+ <Modal
33
+ visible={visible}
34
+ transparent
35
+ animationType="none"
36
+ statusBarTranslucent
37
+ onRequestClose={onCancel}
38
+ >
39
+ <TouchableWithoutFeedback>
40
+ <View style={styles.modalOverlay}>
41
+ <TouchableWithoutFeedback>
42
+ <View style={styles.bottomSheet}>
43
+ <View style={styles.handleContainer}>
44
+ <View style={styles.handle} />
45
+ </View>
46
+
47
+ <SafeAreaView style={styles.container}>
48
+ <View style={styles.content}>
49
+ <Icon name="auto_awesome" size={48} color={COLORS.primary} />
50
+
51
+ <Text style={styles.title}>Training Your AI Model</Text>
52
+ <Text style={styles.subtitle}>
53
+ We're analyzing your social media data to create your personalized AI model
54
+ </Text>
55
+
56
+ <View style={styles.progressContainer}>
57
+ <View style={styles.progressBar}>
58
+ <View
59
+ style={[
60
+ styles.progressFill,
61
+ { width: `${progressPercentage}%` },
62
+ ]}
63
+ />
64
+ </View>
65
+ <Text style={styles.progressText}>{progressPercentage}%</Text>
66
+ </View>
67
+
68
+ <Text style={styles.etaText}>Estimated time remaining: {eta}</Text>
69
+
70
+ <View style={styles.loadingContainer}>
71
+ <ActivityIndicator size="small" color={COLORS.primary} />
72
+ <Text style={styles.loadingText}>Processing your data...</Text>
73
+ </View>
74
+
75
+ <View style={styles.footer}>
76
+ <TouchableOpacity
77
+ style={styles.cancelButton}
78
+ onPress={onCancel}
79
+ >
80
+ <Text style={styles.cancelButtonText}>Cancel</Text>
81
+ </TouchableOpacity>
82
+
83
+ {progress >= 1 && (
84
+ <TouchableOpacity
85
+ style={styles.completeButton}
86
+ onPress={onComplete}
87
+ >
88
+ <Text style={styles.completeButtonText}>Complete</Text>
89
+ </TouchableOpacity>
90
+ )}
91
+ </View>
92
+ </View>
93
+ </SafeAreaView>
94
+ </View>
95
+ </TouchableWithoutFeedback>
96
+ </View>
97
+ </TouchableWithoutFeedback>
98
+ </Modal>
99
+ );
100
+ };
101
+
102
+ const styles = StyleSheet.create({
103
+ modalOverlay: {
104
+ flex: 1,
105
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
106
+ justifyContent: 'flex-end',
107
+ alignItems: 'center',
108
+ },
109
+ bottomSheet: {
110
+ backgroundColor: '#fff',
111
+ width: width,
112
+ height: height * 0.6,
113
+ borderTopLeftRadius: 24,
114
+ borderTopRightRadius: 24,
115
+ overflow: 'hidden',
116
+ },
117
+ handleContainer: {
118
+ width: '100%',
119
+ alignItems: 'center',
120
+ paddingTop: 12,
121
+ paddingBottom: 8,
122
+ },
123
+ handle: {
124
+ width: 40,
125
+ height: 5,
126
+ borderRadius: 3,
127
+ backgroundColor: '#E0E0E0',
128
+ },
129
+ container: {
130
+ flex: 1,
131
+ backgroundColor: '#fff',
132
+ },
133
+ content: {
134
+ flex: 1,
135
+ width: '100%',
136
+ alignItems: 'center',
137
+ justifyContent: 'center',
138
+ padding: 24,
139
+ },
140
+ title: {
141
+ fontSize: 24,
142
+ fontWeight: '600',
143
+ marginTop: 24,
144
+ marginBottom: 8,
145
+ color: COLORS.text.primary,
146
+ textAlign: 'center',
147
+ },
148
+ subtitle: {
149
+ fontSize: 16,
150
+ color: COLORS.text.secondary,
151
+ textAlign: 'center',
152
+ marginBottom: 32,
153
+ },
154
+ progressContainer: {
155
+ width: '100%',
156
+ marginBottom: 16,
157
+ },
158
+ progressBar: {
159
+ height: 8,
160
+ backgroundColor: COLORS.border,
161
+ borderRadius: 4,
162
+ overflow: 'hidden',
163
+ },
164
+ progressFill: {
165
+ height: '100%',
166
+ backgroundColor: COLORS.primary,
167
+ borderRadius: 4,
168
+ },
169
+ progressText: {
170
+ fontSize: 14,
171
+ color: COLORS.text.secondary,
172
+ textAlign: 'center',
173
+ marginTop: 8,
174
+ },
175
+ etaText: {
176
+ fontSize: 14,
177
+ color: COLORS.text.secondary,
178
+ marginBottom: 24,
179
+ },
180
+ loadingContainer: {
181
+ flexDirection: 'row',
182
+ alignItems: 'center',
183
+ marginBottom: 32,
184
+ },
185
+ loadingText: {
186
+ fontSize: 14,
187
+ color: COLORS.text.secondary,
188
+ marginLeft: 8,
189
+ },
190
+ footer: {
191
+ flexDirection: 'row',
192
+ alignItems: 'center',
193
+ justifyContent: 'space-between',
194
+ width: '100%',
195
+ borderTopWidth: 1,
196
+ borderTopColor: '#eee',
197
+ paddingTop: 16,
198
+ paddingHorizontal: 24,
199
+ paddingBottom: 24,
200
+ },
201
+ cancelButton: {
202
+ paddingVertical: 8,
203
+ paddingHorizontal: 16,
204
+ },
205
+ cancelButtonText: {
206
+ fontSize: 16,
207
+ color: '#666',
208
+ },
209
+ completeButton: {
210
+ paddingVertical: 16,
211
+ paddingHorizontal: 32,
212
+ borderRadius: 16,
213
+ backgroundColor: '#fff',
214
+ borderWidth: 1,
215
+ borderColor: '#000',
216
+ },
217
+ completeButtonText: {
218
+ fontSize: 16,
219
+ fontWeight: '600',
220
+ color: '#000',
221
+ },
222
+ });
@@ -51,6 +51,9 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
51
51
  const platforms = [
52
52
  { id: 'instagram', name: 'Instagram', icon: require('../assets/images/instagram.png') },
53
53
  { id: 'youtube', name: 'YouTube', icon: require('../assets/images/youtube.png') },
54
+ { id: 'reddit', name: 'Reddit', icon: require('../assets/images/reddit.png') },
55
+ { id: 'pinterest', name: 'Pinterest', icon: require('../assets/images/pinterest.png') },
56
+ { id: 'email', name: 'Email', icon: require('../assets/images/email.png') },
54
57
  ];
55
58
 
56
59
  const {
@@ -271,13 +274,16 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
271
274
  minLength={8}
272
275
  requireSpecialChar
273
276
  requireNumber
277
+ onBack={() => setStep('connect')}
274
278
  />
275
279
  )}
276
280
 
277
281
  {step === 'training' && (
278
282
  <TrainingModal
279
283
  visible={step === 'training'}
280
- onClose={handleClose}
284
+ progress={training.progress}
285
+ eta={training.eta}
286
+ onCancel={handleClose}
281
287
  onComplete={() => {
282
288
  onComplete('https://api2.onairos.uk', 'dummy-token', {
283
289
  pin,
@@ -289,9 +295,6 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
289
295
  }}
290
296
  modelKey="onairosTrainingModel"
291
297
  username="demo_user"
292
- progress={training.progress}
293
- eta={training.eta}
294
- onCancel={handleClose}
295
298
  />
296
299
  )}
297
300
  </SafeAreaView>
@@ -313,7 +316,7 @@ const styles = StyleSheet.create({
313
316
  bottomSheet: {
314
317
  backgroundColor: '#fff',
315
318
  width: width,
316
- height: height * 0.9,
319
+ height: height * 0.6,
317
320
  borderTopLeftRadius: 24,
318
321
  borderTopRightRadius: 24,
319
322
  overflow: 'hidden',