@oxyhq/services 0.1.18 → 5.1.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 (197) hide show
  1. package/README.md +17 -138
  2. package/UI_COMPONENTS.md +143 -0
  3. package/lib/commonjs/assets/OxyLogo.svg +1 -0
  4. package/lib/commonjs/assets/assets/OxyLogo.svg +1 -0
  5. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  6. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  7. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  8. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  9. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  10. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  11. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  12. package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  13. package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  14. package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  15. package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  16. package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  17. package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  18. package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  19. package/lib/commonjs/core/index.js +783 -0
  20. package/lib/commonjs/core/index.js.map +1 -0
  21. package/lib/commonjs/index.js +137 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/models/interfaces.js +2 -0
  24. package/lib/commonjs/models/interfaces.js.map +1 -0
  25. package/lib/commonjs/package.json +1 -0
  26. package/lib/commonjs/ui/components/Avatar.js +98 -0
  27. package/lib/commonjs/ui/components/Avatar.js.map +1 -0
  28. package/lib/commonjs/ui/components/FontLoader.js +181 -0
  29. package/lib/commonjs/ui/components/FontLoader.js.map +1 -0
  30. package/lib/commonjs/ui/components/OxyLogo.js +56 -0
  31. package/lib/commonjs/ui/components/OxyLogo.js.map +1 -0
  32. package/lib/commonjs/ui/components/OxyProvider.js +464 -0
  33. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -0
  34. package/lib/commonjs/ui/components/OxySignInButton.js +178 -0
  35. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -0
  36. package/lib/commonjs/ui/components/bottomSheet/index.js +37 -0
  37. package/lib/commonjs/ui/components/bottomSheet/index.js.map +1 -0
  38. package/lib/commonjs/ui/context/OxyContext.js +296 -0
  39. package/lib/commonjs/ui/context/OxyContext.js.map +1 -0
  40. package/lib/commonjs/ui/index.js +144 -0
  41. package/lib/commonjs/ui/index.js.map +1 -0
  42. package/lib/commonjs/ui/navigation/OxyRouter.js +145 -0
  43. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -0
  44. package/lib/commonjs/ui/navigation/types.js +6 -0
  45. package/lib/commonjs/ui/navigation/types.js.map +1 -0
  46. package/lib/commonjs/ui/screens/AboutKarmaScreen.js +45 -0
  47. package/lib/commonjs/ui/screens/AboutKarmaScreen.js.map +1 -0
  48. package/lib/commonjs/ui/screens/AccountCenterScreen.js +280 -0
  49. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -0
  50. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +566 -0
  51. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -0
  52. package/lib/commonjs/ui/screens/SignInScreen.js +230 -0
  53. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -0
  54. package/lib/commonjs/ui/screens/SignUpScreen.js +673 -0
  55. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -0
  56. package/lib/commonjs/ui/styles/FONTS.md +126 -0
  57. package/lib/commonjs/ui/styles/fonts.js +84 -0
  58. package/lib/commonjs/ui/styles/fonts.js.map +1 -0
  59. package/lib/commonjs/ui/styles/index.js +28 -0
  60. package/lib/commonjs/ui/styles/index.js.map +1 -0
  61. package/lib/commonjs/ui/styles/theme.js +122 -0
  62. package/lib/commonjs/ui/styles/theme.js.map +1 -0
  63. package/lib/module/assets/OxyLogo.svg +1 -0
  64. package/lib/module/assets/assets/OxyLogo.svg +1 -0
  65. package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  66. package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  67. package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  68. package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  69. package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  70. package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  71. package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  72. package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  73. package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  74. package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  75. package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  76. package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  77. package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  78. package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  79. package/lib/module/core/index.js +777 -0
  80. package/lib/module/core/index.js.map +1 -0
  81. package/lib/module/index.js +40 -0
  82. package/lib/module/index.js.map +1 -0
  83. package/lib/module/models/interfaces.js +2 -0
  84. package/lib/module/models/interfaces.js.map +1 -0
  85. package/lib/module/package.json +1 -0
  86. package/lib/module/ui/components/Avatar.js +93 -0
  87. package/lib/module/ui/components/Avatar.js.map +1 -0
  88. package/lib/module/ui/components/FontLoader.js +176 -0
  89. package/lib/module/ui/components/FontLoader.js.map +1 -0
  90. package/lib/module/ui/components/OxyLogo.js +49 -0
  91. package/lib/module/ui/components/OxyLogo.js.map +1 -0
  92. package/lib/module/ui/components/OxyProvider.js +458 -0
  93. package/lib/module/ui/components/OxyProvider.js.map +1 -0
  94. package/lib/module/ui/components/OxySignInButton.js +172 -0
  95. package/lib/module/ui/components/OxySignInButton.js.map +1 -0
  96. package/lib/module/ui/components/bottomSheet/index.js +8 -0
  97. package/lib/module/ui/components/bottomSheet/index.js.map +1 -0
  98. package/lib/module/ui/context/OxyContext.js +291 -0
  99. package/lib/module/ui/context/OxyContext.js.map +1 -0
  100. package/lib/module/ui/index.js +26 -0
  101. package/lib/module/ui/index.js.map +1 -0
  102. package/lib/module/ui/navigation/OxyRouter.js +138 -0
  103. package/lib/module/ui/navigation/OxyRouter.js.map +1 -0
  104. package/lib/module/ui/navigation/types.js +4 -0
  105. package/lib/module/ui/navigation/types.js.map +1 -0
  106. package/lib/module/ui/screens/AboutKarmaScreen.js +40 -0
  107. package/lib/module/ui/screens/AboutKarmaScreen.js.map +1 -0
  108. package/lib/module/ui/screens/AccountCenterScreen.js +275 -0
  109. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -0
  110. package/lib/module/ui/screens/AccountOverviewScreen.js +560 -0
  111. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -0
  112. package/lib/module/ui/screens/SignInScreen.js +224 -0
  113. package/lib/module/ui/screens/SignInScreen.js.map +1 -0
  114. package/lib/module/ui/screens/SignUpScreen.js +668 -0
  115. package/lib/module/ui/screens/SignUpScreen.js.map +1 -0
  116. package/lib/module/ui/styles/FONTS.md +126 -0
  117. package/lib/module/ui/styles/fonts.js +81 -0
  118. package/lib/module/ui/styles/fonts.js.map +1 -0
  119. package/lib/module/ui/styles/index.js +5 -0
  120. package/lib/module/ui/styles/index.js.map +1 -0
  121. package/lib/module/ui/styles/theme.js +115 -0
  122. package/lib/module/ui/styles/theme.js.map +1 -0
  123. package/lib/typescript/core/index.d.ts +304 -0
  124. package/lib/typescript/core/index.d.ts.map +1 -0
  125. package/lib/typescript/index.d.ts +14 -0
  126. package/lib/typescript/index.d.ts.map +1 -0
  127. package/lib/typescript/models/interfaces.d.ts +98 -0
  128. package/lib/typescript/models/interfaces.d.ts.map +1 -0
  129. package/lib/typescript/ui/components/Avatar.d.ts +62 -0
  130. package/lib/typescript/ui/components/Avatar.d.ts.map +1 -0
  131. package/lib/typescript/ui/components/FontLoader.d.ts +15 -0
  132. package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -0
  133. package/lib/typescript/ui/components/OxyLogo.d.ts +29 -0
  134. package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -0
  135. package/lib/typescript/ui/components/OxyProvider.d.ts +12 -0
  136. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -0
  137. package/lib/typescript/ui/components/OxySignInButton.d.ts +65 -0
  138. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -0
  139. package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -0
  140. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -0
  141. package/lib/typescript/ui/context/OxyContext.d.ts +26 -0
  142. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -0
  143. package/lib/typescript/ui/index.d.ts +16 -0
  144. package/lib/typescript/ui/index.d.ts.map +1 -0
  145. package/lib/typescript/ui/navigation/OxyRouter.d.ts +5 -0
  146. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -0
  147. package/lib/typescript/ui/navigation/types.d.ts +107 -0
  148. package/lib/typescript/ui/navigation/types.d.ts.map +1 -0
  149. package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts +5 -0
  150. package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts.map +1 -0
  151. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +5 -0
  152. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -0
  153. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +5 -0
  154. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -0
  155. package/lib/typescript/ui/screens/SignInScreen.d.ts +5 -0
  156. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -0
  157. package/lib/typescript/ui/screens/SignUpScreen.d.ts +5 -0
  158. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -0
  159. package/lib/typescript/ui/styles/fonts.d.ts +21 -0
  160. package/lib/typescript/ui/styles/fonts.d.ts.map +1 -0
  161. package/lib/typescript/ui/styles/index.d.ts +3 -0
  162. package/lib/typescript/ui/styles/index.d.ts.map +1 -0
  163. package/lib/typescript/ui/styles/theme.d.ts +69 -0
  164. package/lib/typescript/ui/styles/theme.d.ts.map +1 -0
  165. package/package.json +95 -51
  166. package/src/assets/OxyLogo.svg +1 -0
  167. package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  168. package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  169. package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  170. package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  171. package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  172. package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  173. package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  174. package/src/core/index.ts +768 -0
  175. package/src/index.ts +57 -0
  176. package/src/models/interfaces.ts +128 -0
  177. package/src/ui/components/Avatar.tsx +155 -0
  178. package/src/ui/components/FontLoader.tsx +180 -0
  179. package/src/ui/components/OxyLogo.tsx +73 -0
  180. package/src/ui/components/OxyProvider.tsx +490 -0
  181. package/src/ui/components/OxySignInButton.tsx +207 -0
  182. package/src/ui/components/bottomSheet/index.tsx +12 -0
  183. package/src/ui/context/OxyContext.tsx +344 -0
  184. package/src/ui/index.ts +28 -0
  185. package/src/ui/navigation/OxyRouter.tsx +142 -0
  186. package/src/ui/navigation/types.ts +124 -0
  187. package/src/ui/screens/AboutKarmaScreen.tsx +52 -0
  188. package/src/ui/screens/AccountCenterScreen.tsx +240 -0
  189. package/src/ui/screens/AccountOverviewScreen.tsx +512 -0
  190. package/src/ui/screens/SignInScreen.tsx +210 -0
  191. package/src/ui/screens/SignUpScreen.tsx +607 -0
  192. package/src/ui/styles/FONTS.md +126 -0
  193. package/src/ui/styles/fonts.ts +77 -0
  194. package/src/ui/styles/index.ts +2 -0
  195. package/src/ui/styles/theme.ts +142 -0
  196. package/dist/index.d.ts +0 -152
  197. package/dist/index.js +0 -1
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+
3
+ import React, { createContext, useContext, useState, useEffect, useCallback } from 'react';
4
+
5
+ // Define the context shape
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ // Create the context with default values
8
+ const OxyContext = /*#__PURE__*/createContext(null);
9
+
10
+ // Props for the OxyContextProvider
11
+
12
+ // Platform storage implementation
13
+
14
+ // Web localStorage implementation
15
+ class WebStorage {
16
+ async getItem(key) {
17
+ return localStorage.getItem(key);
18
+ }
19
+ async setItem(key, value) {
20
+ localStorage.setItem(key, value);
21
+ }
22
+ async removeItem(key) {
23
+ localStorage.removeItem(key);
24
+ }
25
+ async clear() {
26
+ localStorage.clear();
27
+ }
28
+ }
29
+
30
+ // React Native AsyncStorage implementation
31
+ // This will be dynamically imported only in React Native environment
32
+ let AsyncStorage;
33
+
34
+ // Determine the platform and set up storage
35
+ const isReactNative = () => {
36
+ return typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
37
+ };
38
+
39
+ // Get appropriate storage for the platform
40
+ const getStorage = async () => {
41
+ if (isReactNative()) {
42
+ // Dynamically import AsyncStorage only in React Native environment
43
+ if (!AsyncStorage) {
44
+ try {
45
+ const asyncStorageModule = await import('@react-native-async-storage/async-storage');
46
+ AsyncStorage = asyncStorageModule.default;
47
+ } catch (error) {
48
+ console.error('Failed to import AsyncStorage:', error);
49
+ throw new Error('AsyncStorage is required in React Native environment');
50
+ }
51
+ }
52
+ return AsyncStorage;
53
+ }
54
+
55
+ // Default to web storage
56
+ return new WebStorage();
57
+ };
58
+
59
+ // Storage keys
60
+ const getStorageKeys = (prefix = 'oxy') => ({
61
+ accessToken: `${prefix}_access_token`,
62
+ refreshToken: `${prefix}_refresh_token`,
63
+ user: `${prefix}_user`
64
+ });
65
+ export const OxyContextProvider = ({
66
+ children,
67
+ oxyServices,
68
+ storageKeyPrefix = 'oxy',
69
+ onAuthStateChange,
70
+ bottomSheetRef
71
+ }) => {
72
+ // Authentication state
73
+ const [user, setUser] = useState(null);
74
+ const [isLoading, setIsLoading] = useState(true);
75
+ const [error, setError] = useState(null);
76
+ const [storage, setStorage] = useState(null);
77
+
78
+ // Storage keys
79
+ const keys = getStorageKeys(storageKeyPrefix);
80
+
81
+ // Initialize storage
82
+ useEffect(() => {
83
+ const initStorage = async () => {
84
+ try {
85
+ const platformStorage = await getStorage();
86
+ setStorage(platformStorage);
87
+ } catch (error) {
88
+ console.error('Failed to initialize storage:', error);
89
+ setError('Failed to initialize storage');
90
+ }
91
+ };
92
+ initStorage();
93
+ }, []);
94
+
95
+ // Effect to initialize authentication state
96
+ useEffect(() => {
97
+ const initAuth = async () => {
98
+ if (!storage) return;
99
+ setIsLoading(true);
100
+ try {
101
+ // Try to load tokens from storage
102
+ const accessToken = await storage.getItem(keys.accessToken);
103
+ const refreshToken = await storage.getItem(keys.refreshToken);
104
+ const storedUser = await storage.getItem(keys.user);
105
+ if (accessToken) {
106
+ // Set tokens in OxyServices
107
+ if (refreshToken) {
108
+ oxyServices.setTokens(accessToken, refreshToken);
109
+ } else {
110
+ // Use setTokens with the same token if setToken is not available
111
+ oxyServices.setTokens(accessToken, accessToken);
112
+ }
113
+
114
+ // Validate the tokens
115
+ const isValid = await oxyServices.validate();
116
+ if (isValid && storedUser) {
117
+ // Set user state
118
+ const parsedUser = JSON.parse(storedUser);
119
+ setUser(parsedUser);
120
+
121
+ // Notify about auth state change
122
+ if (onAuthStateChange) {
123
+ onAuthStateChange(parsedUser);
124
+ }
125
+ } else {
126
+ // Tokens are invalid, clear everything
127
+ await clearStorage();
128
+ oxyServices.clearTokens();
129
+ }
130
+ }
131
+ } catch (err) {
132
+ console.error('Auth initialization error:', err);
133
+ await clearStorage();
134
+ oxyServices.clearTokens();
135
+ } finally {
136
+ setIsLoading(false);
137
+ }
138
+ };
139
+ if (storage) {
140
+ initAuth();
141
+ }
142
+ }, [storage, oxyServices, keys.accessToken, keys.refreshToken, keys.user, onAuthStateChange]);
143
+
144
+ // Helper to clear storage
145
+ const clearStorage = async () => {
146
+ if (!storage) return;
147
+ try {
148
+ await storage.removeItem(keys.accessToken);
149
+ await storage.removeItem(keys.refreshToken);
150
+ await storage.removeItem(keys.user);
151
+ } catch (err) {
152
+ console.error('Clear storage error:', err);
153
+ }
154
+ };
155
+
156
+ // Utility function to handle different token response formats
157
+ const storeTokens = async response => {
158
+ // Store token and user data
159
+ if (response.accessToken) {
160
+ await storage?.setItem(keys.accessToken, response.accessToken);
161
+ if (response.refreshToken) {
162
+ await storage?.setItem(keys.refreshToken, response.refreshToken);
163
+ }
164
+ } else if (response.token) {
165
+ // Handle legacy API response
166
+ await storage?.setItem(keys.accessToken, response.token);
167
+ }
168
+ await storage?.setItem(keys.user, JSON.stringify(response.user));
169
+ };
170
+
171
+ // Login method
172
+ const login = async (username, password) => {
173
+ if (!storage) throw new Error('Storage not initialized');
174
+ setIsLoading(true);
175
+ setError(null);
176
+ try {
177
+ const response = await oxyServices.login(username, password);
178
+ setUser(response.user);
179
+
180
+ // Store tokens
181
+ await storeTokens(response);
182
+
183
+ // Notify about auth state change
184
+ if (onAuthStateChange) {
185
+ onAuthStateChange(response.user);
186
+ }
187
+ return response.user;
188
+ } catch (err) {
189
+ setError(err.message || 'Login failed');
190
+ throw err;
191
+ } finally {
192
+ setIsLoading(false);
193
+ }
194
+ };
195
+
196
+ // Logout method
197
+ const logout = async () => {
198
+ if (!storage) throw new Error('Storage not initialized');
199
+ setIsLoading(true);
200
+ setError(null);
201
+ try {
202
+ await oxyServices.logout();
203
+ await clearStorage();
204
+ setUser(null);
205
+
206
+ // Notify about auth state change
207
+ if (onAuthStateChange) {
208
+ onAuthStateChange(null);
209
+ }
210
+ } catch (err) {
211
+ setError(err.message || 'Logout failed');
212
+ throw err;
213
+ } finally {
214
+ setIsLoading(false);
215
+ }
216
+ };
217
+
218
+ // Sign up method
219
+ const signUp = async (username, email, password) => {
220
+ if (!storage) throw new Error('Storage not initialized');
221
+ setIsLoading(true);
222
+ setError(null);
223
+ try {
224
+ const response = await oxyServices.signUp(username, email, password);
225
+ setUser(response.user);
226
+
227
+ // Store tokens
228
+ await storeTokens(response);
229
+
230
+ // Notify about auth state change
231
+ if (onAuthStateChange) {
232
+ onAuthStateChange(response.user);
233
+ }
234
+ return response.user;
235
+ } catch (err) {
236
+ setError(err.message || 'Sign up failed');
237
+ throw err;
238
+ } finally {
239
+ setIsLoading(false);
240
+ }
241
+ };
242
+
243
+ // Methods to control the bottom sheet
244
+ const showBottomSheet = useCallback(screen => {
245
+ if (bottomSheetRef?.current) {
246
+ // Expand the bottom sheet
247
+ bottomSheetRef.current.expand();
248
+
249
+ // If a screen is specified, navigate to it
250
+ if (screen && bottomSheetRef.current._navigateToScreen) {
251
+ setTimeout(() => {
252
+ bottomSheetRef.current._navigateToScreen(screen);
253
+ }, 100); // Small delay to ensure the sheet is expanded first
254
+ }
255
+ }
256
+ }, [bottomSheetRef]);
257
+ const hideBottomSheet = useCallback(() => {
258
+ if (bottomSheetRef?.current) {
259
+ bottomSheetRef.current.close();
260
+ }
261
+ }, [bottomSheetRef]);
262
+
263
+ // Build context value
264
+ const contextValue = {
265
+ user,
266
+ isAuthenticated: !!user,
267
+ isLoading,
268
+ error,
269
+ login,
270
+ logout,
271
+ signUp,
272
+ oxyServices,
273
+ bottomSheetRef,
274
+ showBottomSheet,
275
+ hideBottomSheet
276
+ };
277
+ return /*#__PURE__*/_jsx(OxyContext.Provider, {
278
+ value: contextValue,
279
+ children: children
280
+ });
281
+ };
282
+
283
+ // Hook to use the context
284
+ export const useOxy = () => {
285
+ const context = useContext(OxyContext);
286
+ if (!context) {
287
+ throw new Error('useOxy must be used within an OxyContextProvider');
288
+ }
289
+ return context;
290
+ };
291
+ //# sourceMappingURL=OxyContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","createContext","useContext","useState","useEffect","useCallback","jsx","_jsx","OxyContext","WebStorage","getItem","key","localStorage","setItem","value","removeItem","clear","AsyncStorage","isReactNative","navigator","product","getStorage","asyncStorageModule","default","error","console","Error","getStorageKeys","prefix","accessToken","refreshToken","user","OxyContextProvider","children","oxyServices","storageKeyPrefix","onAuthStateChange","bottomSheetRef","setUser","isLoading","setIsLoading","setError","storage","setStorage","keys","initStorage","platformStorage","initAuth","storedUser","setTokens","isValid","validate","parsedUser","JSON","parse","clearStorage","clearTokens","err","storeTokens","response","token","stringify","login","username","password","message","logout","signUp","email","showBottomSheet","screen","current","expand","_navigateToScreen","setTimeout","hideBottomSheet","close","contextValue","isAuthenticated","Provider","useOxy","context"],"sourceRoot":"../../../../src","sources":["ui/context/OxyContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAmB,OAAO;;AAIrG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAsBA;AACA,MAAMC,UAAU,gBAAGP,aAAa,CAAyB,IAAI,CAAC;;AAE9D;;AASA;;AAQA;AACA,MAAMQ,UAAU,CAA6B;EACzC,MAAMC,OAAOA,CAACC,GAAW,EAA0B;IAC/C,OAAOC,YAAY,CAACF,OAAO,CAACC,GAAG,CAAC;EACpC;EAEA,MAAME,OAAOA,CAACF,GAAW,EAAEG,KAAa,EAAiB;IACrDF,YAAY,CAACC,OAAO,CAACF,GAAG,EAAEG,KAAK,CAAC;EACpC;EAEA,MAAMC,UA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A,CAAA,KAAM;EACxB,MAAMC,OAAO,GAAG/E,UAAU,CAACM,UAAU,CAAC;EACtC,IAAI,CAACyE,OAAO,EAAE;IACV,MAAM,IAAIvD,KAAK,CAAC,kDAAkD,CAAC;EACvE;EACA,OAAOuD,OAAO;AAClB,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * UI Component exports
5
+ */
6
+
7
+ // Export the main provider component and context
8
+ export { default as OxyProvider } from './components/OxyProvider';
9
+ export { default as OxySignInButton } from './components/OxySignInButton';
10
+ export { default as OxyLogo } from './components/OxyLogo';
11
+ export { default as Avatar } from './components/Avatar';
12
+ export { FontLoader, setupFonts } from './components/FontLoader';
13
+ export { OxyContextProvider, useOxy, OxyContextState, OxyContextProviderProps } from './context/OxyContext';
14
+
15
+ // Export styles
16
+ export { fontFamilies, fontStyles } from './styles/fonts';
17
+
18
+ // Export screen components
19
+ export { default as SignInScreen } from './screens/SignInScreen';
20
+ export { default as SignUpScreen } from './screens/SignUpScreen';
21
+ export { default as AccountCenterScreen } from './screens/AccountCenterScreen';
22
+ export { default as AccountOverviewScreen } from './screens/AccountOverviewScreen';
23
+
24
+ // Export types
25
+ export * from './navigation/types';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","OxyProvider","OxySignInButton","OxyLogo","Avatar","FontLoader","setupFonts","OxyContextProvider","useOxy","OxyContextState","OxyContextProviderProps","fontFamilies","fontStyles","SignInScreen","SignUpScreen","AccountCenterScreen","AccountOverviewScreen"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,0BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,8BAA8B;AACzE,SAASF,OAAO,IAAIG,OAAO,QAAQ,sBAAsB;AACzD,SAASH,OAAO,IAAII,MAAM,QAAQ,qBAAqB;AACvD,SAASC,UAAU,EAAEC,UAAU,QAAQ,yBAAyB;AAChE,SACEC,kBAAkB,EAClBC,MAAM,EACNC,eAAe,EACfC,uBAAuB,QAClB,sBAAsB;;AAE7B;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;;AAEzD;AACA,SAASZ,OAAO,IAAIa,YAAY,QAAQ,wBAAwB;AAChE,SAASb,OAAO,IAAIc,YAAY,QAAQ,wBAAwB;AAChE,SAASd,OAAO,IAAIe,mBAAmB,QAAQ,+BAA+B;AAC9E,SAASf,OAAO,IAAIgB,qBAAqB,QAAQ,iCAAiC;;AAElF;AACA,cAAc,oBAAoB","ignoreList":[]}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ import React, { useState, useEffect } from 'react';
4
+ import { View, StyleSheet } from 'react-native';
5
+ // Import screens
6
+ import SignInScreen from '../screens/SignInScreen';
7
+ import SignUpScreen from '../screens/SignUpScreen';
8
+ import AccountCenterScreen from '../screens/AccountCenterScreen';
9
+ import AccountOverviewScreen from '../screens/AccountOverviewScreen';
10
+ import AboutKarmaScreen from '../screens/AboutKarmaScreen';
11
+
12
+ // Import types
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ // Define route configuration with screen components and default snap points
15
+ const routes = {
16
+ SignIn: {
17
+ component: SignInScreen,
18
+ snapPoints: ['60%', '80%']
19
+ },
20
+ SignUp: {
21
+ component: SignUpScreen,
22
+ snapPoints: ['70%', '90%']
23
+ },
24
+ AccountCenter: {
25
+ component: AccountCenterScreen,
26
+ snapPoints: ['60%', '100%']
27
+ },
28
+ AccountOverview: {
29
+ component: AccountOverviewScreen,
30
+ snapPoints: ['60%', '85%']
31
+ },
32
+ AboutKarma: {
33
+ component: AboutKarmaScreen,
34
+ snapPoints: ['60%', '90%']
35
+ }
36
+ };
37
+ const OxyRouter = ({
38
+ oxyServices,
39
+ initialScreen,
40
+ onClose,
41
+ onAuthenticated,
42
+ theme,
43
+ adjustSnapPoints
44
+ }) => {
45
+ const [currentScreen, setCurrentScreen] = useState(initialScreen);
46
+ const [screenHistory, setScreenHistory] = useState([initialScreen]);
47
+ const [screenProps, setScreenProps] = useState({});
48
+
49
+ // Update snap points when the screen changes
50
+ useEffect(() => {
51
+ if (routes[currentScreen]) {
52
+ adjustSnapPoints(routes[currentScreen].snapPoints);
53
+ }
54
+ }, [currentScreen, adjustSnapPoints]);
55
+
56
+ // Navigation methods
57
+ const navigate = (screen, props = {}) => {
58
+ if (routes[screen]) {
59
+ setCurrentScreen(screen);
60
+ setScreenHistory(prev => [...prev, screen]);
61
+ setScreenProps(props);
62
+ } else {
63
+ console.error(`Screen "${screen}" not found`);
64
+ }
65
+ }; // Expose the navigate method to the parent component (OxyProvider)
66
+ useEffect(() => {
67
+ // Set up event listener for navigation events
68
+ const handleNavigationEvent = event => {
69
+ if (event && event.detail) {
70
+ const screenName = event.detail;
71
+ console.log(`Navigation event received for screen: ${screenName}`);
72
+ navigate(screenName);
73
+ }
74
+ };
75
+
76
+ // Add event listener (web only)
77
+ if (typeof document !== 'undefined') {
78
+ document.addEventListener('oxy:navigate', handleNavigationEvent);
79
+ }
80
+
81
+ // Cleanup
82
+ return () => {
83
+ if (typeof document !== 'undefined') {
84
+ document.removeEventListener('oxy:navigate', handleNavigationEvent);
85
+ }
86
+ };
87
+ }, []);
88
+ const goBack = () => {
89
+ if (screenHistory.length > 1) {
90
+ const newHistory = [...screenHistory];
91
+ newHistory.pop();
92
+ const previousScreen = newHistory[newHistory.length - 1];
93
+ setCurrentScreen(previousScreen);
94
+ setScreenHistory(newHistory);
95
+ } else {
96
+ // If no history, close the UI
97
+ if (onClose) {
98
+ onClose();
99
+ }
100
+ }
101
+ };
102
+
103
+ // Render the current screen component
104
+ const renderScreen = () => {
105
+ const CurrentScreen = routes[currentScreen]?.component;
106
+ if (!CurrentScreen) {
107
+ console.error(`Screen "${currentScreen}" not found`);
108
+ return /*#__PURE__*/_jsx(View, {
109
+ style: styles.errorContainer
110
+ });
111
+ }
112
+ return /*#__PURE__*/_jsx(CurrentScreen, {
113
+ oxyServices: oxyServices,
114
+ navigate: navigate,
115
+ goBack: goBack,
116
+ onClose: onClose,
117
+ onAuthenticated: onAuthenticated,
118
+ theme: theme,
119
+ ...screenProps
120
+ });
121
+ };
122
+ return /*#__PURE__*/_jsx(View, {
123
+ style: styles.container,
124
+ children: renderScreen()
125
+ });
126
+ };
127
+ const styles = StyleSheet.create({
128
+ container: {
129
+ flex: 1
130
+ },
131
+ errorContainer: {
132
+ flex: 1,
133
+ justifyContent: 'center',
134
+ alignItems: 'center'
135
+ }
136
+ });
137
+ export default OxyRouter;
138
+ //# sourceMappingURL=OxyRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","useEffect","View","StyleSheet","SignInScreen","SignUpScreen","AccountCenterScreen","AccountOverviewScreen","AboutKarmaScreen","jsx","_jsx","routes","SignIn","component","snapPoints","SignUp","AccountCenter","AccountOverview","AboutKarma","OxyRouter","oxyServices","initialScreen","onClose","onAuthenticated","theme","adjustSnapPoints","currentScreen","setCurrentScreen","screenHistory","setScreenHistory","screenProps","setScreenProps","navigate","screen","props","prev","console","error","handleNavigationEvent","event","detail","screenName","log","document","addEventListener","removeEventListener","goBack","length","newHistory","pop","previousScreen","renderScreen","CurrentScreen","style","styles","errorContainer","container","children","create","flex","justifyContent","alignItems"],"sourceRoot":"../../../../src","sources":["ui/navigation/OxyRouter.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAG/C;AACA,OAAOC,YAAY,MAAM,yBAAyB;AAClD,OAAOC,YAAY,MAAM,yBAAyB;AAClD,OAAOC,mBAAmB,MAAM,gCAAgC;AAChE,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,OAAOC,gBAAgB,MAAM,6BAA6B;;AAE1D;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGA;AACA,MAAMC,MAAmC,GAAG;E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,CAAC;;EAED;EACA,MAAM6B,YAAY,GAAGA,CAAA,KAAM;IACvB,MAAMC,aAAa,GAAGzC,MAAM,CAACe,aAAa,CAAC,EAAEb,SAAS;IAEtD,IAAI,CAACuC,aAAa,EAAE;MAChBhB,OAAO,CAACC,KAAK,CAAC,WAAWX,aAAa,aAAa,CAAC;MACpD,oBAAOhB,IAAA,CAACR,IAAI;QAACmD,KAAK,EAAEC,MAAM,CAACC;MAAe,CAAE,CAAC;IACjD;IAEA,oBACI7C,IAAA,CAAC0C,aAAa;MACVhC,WAAW,EAAEA,WAAY;MACzBY,QAAQ,EAAEA,QAAS;MACnBc,MAAM,EAAEA,MAAO;MACfxB,OAAO,EAAEA,OAAQ;MACjBC,eAAe,EAAEA,eAAgB;MACjCC,KAAK,EAAEA,KAAM;MAAA,GACTM;IAAW,CAClB,CAAC;EAEV,CAAC;EAED,oBAAOpB,IAAA,CAACR,IAAI;IAACmD,KAAK,EAAEC,MAAM,CAACE,SAAU;IAAAC,QAAA,EAAEN,YAAY,CAAC;EAAC,CAAO,CAAC;AACjE,CAAC;AAED,MAAMG,MAAM,GAAGnD,UAAU,CAACuD,MAAM,CAAC;EAC7BF,SAAS,EAAE;IACPG,IAAI,EAAE;EACV,CAAC;EACDJ,cAAc,EAAE;IACZI,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EAChB;AACJ,CAAC,CAAC;AAEF,eAAe1C,SAAS","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["ui/navigation/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Text, StyleSheet } from 'react-native';
5
+ import { fontFamilies } from '../styles/fonts';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const AboutKarmaScreen = ({
8
+ onClose,
9
+ theme
10
+ }) => {
11
+ return /*#__PURE__*/_jsxs(View, {
12
+ style: [styles.container],
13
+ children: [/*#__PURE__*/_jsx(Text, {
14
+ style: [styles.message],
15
+ children: "About Karma"
16
+ }), /*#__PURE__*/_jsx(Text, {
17
+ style: [styles.message],
18
+ children: "Karma is a system that rewards users for their contributions to the community. The more you contribute, the more karma points you earn!"
19
+ }), /*#__PURE__*/_jsx(Text, {
20
+ style: [styles.message],
21
+ children: "Your karma points can be used to unlock special features and benefits within the app."
22
+ }), /*#__PURE__*/_jsx(Text, {
23
+ style: [styles.message],
24
+ children: "Thank you for being a part of our community!"
25
+ })]
26
+ });
27
+ };
28
+ const styles = StyleSheet.create({
29
+ container: {
30
+ flex: 1
31
+ },
32
+ message: {
33
+ fontSize: 20,
34
+ fontFamily: fontFamilies.phuduBold,
35
+ textAlign: 'center',
36
+ marginTop: 20
37
+ }
38
+ });
39
+ export default AboutKarmaScreen;
40
+ //# sourceMappingURL=AboutKarmaScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Text","StyleSheet","fontFamilies","jsx","_jsx","jsxs","_jsxs","AboutKarmaScreen","onClose","theme","style","styles","container","children","message","create","flex","fontSize","fontFamily","phuduBold","textAlign","marginTop"],"sourceRoot":"../../../../src","sources":["ui/screens/AboutKarmaScreen.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAoB,OAAO;AACvC,SACIC,IAAI,EACJC,IAAI,EAEJC,UAAU,QAOP,cAAc;AAErB,SAASC,YAAY,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/C,MAAMC,gBAA2C,GAAGA,CAAC;EACjDC,OAAO;EACPC;AACJ,CAAC,KAAK;EAGF,oBACIH,KAAA,CAACP,IAAI;IAACW,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,CAAE;IAAAC,QAAA,gBAC5BT,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACG,OAAO,CAAE;MAAAD,QAAA,EAAC;IAAW,CAAM,CAAC,eACjDT,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACG,OAAO,CAAE;MAAAD,QAAA,EAAC;IAG/B,CAAM,CAAC,eACPT,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACG,OAAO,CAAE;MAAAD,QAAA,EAAC;IAE/B,CAAM,CAAC,eACPT,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACG,OAAO,CAAE;MAAAD,QAAA,EAAC;IAE/B,CAAM,CAAC;EAAA,CACL,CAAC;AAEf,CAAC;AAED,MAAMF,MAAM,GAAGV,UAAU,CAACc,MAAM,CAAC;EAC7BH,SAAS,EAAE;IACPI,IAAI,EAAE;EACV,CAAC;EACDF,OAAO,EAAE;IACLG,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAEhB,YAAY,CAACiB,SAAS;IAClCC,SAAS,EAAE,QAAQ;IACnBC,SAAS,EAAE;EACf;AACJ,CAAC,CAAC;AAEF,eAAed,gBAAgB","ignoreList":[]}