@oxyhq/services 5.5.9 → 5.6.1
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 +16 -2
- package/lib/commonjs/core/index.js +69 -82
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +24 -183
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/index.js +0 -2
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +100 -229
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +41 -198
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/commonjs/ui/components/icon/index.js +7 -0
- package/lib/commonjs/ui/components/icon/index.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
- package/lib/commonjs/ui/components/internal/TextField.js +20 -0
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +116 -84
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +2 -15
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +52 -136
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/commonjs/ui/index.js +8 -191
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +90 -39
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +66 -0
- package/lib/commonjs/ui/stores/authStore.js.map +1 -0
- package/lib/commonjs/ui/stores/followStore.js +124 -0
- package/lib/commonjs/ui/stores/followStore.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +0 -11
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/utils/confirmAction.js +28 -0
- package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
- package/lib/module/core/index.js +69 -81
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +14 -17
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/index.js +0 -3
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +100 -229
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +125 -0
- package/lib/module/ui/components/OxyPayButton.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +42 -199
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +15 -2
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/module/ui/components/icon/index.js +1 -0
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +103 -0
- package/lib/module/ui/components/internal/PinInput.js.map +1 -0
- package/lib/module/ui/components/internal/TextField.js +20 -0
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +117 -85
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +1 -2
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +52 -137
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +47 -0
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/module/ui/index.js +2 -13
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +53 -61
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +91 -40
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +22 -45
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +44 -23
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +59 -78
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +100 -334
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +137 -341
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +62 -0
- package/lib/module/ui/stores/authStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +120 -0
- package/lib/module/ui/stores/followStore.js.map +1 -0
- package/lib/module/ui/styles/index.js +0 -1
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/utils/confirmAction.js +25 -0
- package/lib/module/ui/utils/confirmAction.js.map +1 -0
- package/lib/typescript/core/index.d.ts +28 -10
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +6 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/secureSession.d.ts +0 -1
- package/lib/typescript/models/secureSession.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +0 -1
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +0 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +1 -2
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +2 -5
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +5 -23
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +16 -0
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/followStore.d.ts +15 -0
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +0 -1
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
- package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
- package/package.json +12 -7
- package/src/core/index.ts +78 -88
- package/src/index.ts +8 -45
- package/src/models/interfaces.ts +7 -1
- package/src/models/secureSession.ts +1 -2
- package/src/node/index.ts +0 -3
- package/src/ui/components/FollowButton.tsx +100 -322
- package/src/ui/components/OxyPayButton.tsx +133 -0
- package/src/ui/components/OxyProvider.tsx +39 -201
- package/src/ui/components/OxySignInButton.tsx +13 -2
- package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
- package/src/ui/components/icon/index.ts +1 -0
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
- package/src/ui/components/internal/PinInput.tsx +102 -0
- package/src/ui/components/internal/TextField.tsx +9 -0
- package/src/ui/context/OxyContext.tsx +74 -91
- package/src/ui/hooks/index.ts +1 -2
- package/src/ui/hooks/useFollow.ts +58 -129
- package/src/ui/hooks/useSessionSocket.ts +50 -0
- package/src/ui/index.ts +2 -37
- package/src/ui/navigation/OxyRouter.tsx +47 -63
- package/src/ui/navigation/types.ts +5 -26
- package/src/ui/screens/AccountCenterScreen.tsx +12 -21
- package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
- package/src/ui/screens/AccountSettingsScreen.tsx +75 -46
- package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
- package/src/ui/screens/AppInfoScreen.tsx +27 -47
- package/src/ui/screens/FeedbackScreen.tsx +34 -19
- package/src/ui/screens/FileManagementScreen.tsx +293 -321
- package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
- package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
- package/src/ui/screens/SessionManagementScreen.tsx +65 -137
- package/src/ui/screens/SignInScreen.tsx +89 -283
- package/src/ui/screens/SignUpScreen.tsx +138 -291
- package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
- package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
- package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
- package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
- package/src/ui/stores/authStore.ts +45 -0
- package/src/ui/stores/followStore.ts +80 -0
- package/src/ui/styles/index.ts +0 -1
- package/src/ui/utils/confirmAction.ts +23 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
- package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -217
- package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
- package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
- package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/commonjs/ui/store/index.js +0 -67
- package/lib/commonjs/ui/store/index.js.map +0 -1
- package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
- package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
- package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
- package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
- package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/index.js +0 -129
- package/lib/commonjs/ui/store/slices/index.js.map +0 -1
- package/lib/commonjs/ui/store/slices/types.js +0 -19
- package/lib/commonjs/ui/store/slices/types.js.map +0 -1
- package/lib/commonjs/ui/styles/shadows.js +0 -123
- package/lib/commonjs/ui/styles/shadows.js.map +0 -1
- package/lib/commonjs/utils/polyfills.js +0 -42
- package/lib/commonjs/utils/polyfills.js.map +0 -1
- package/lib/module/ui/components/bottomSheet/index.js +0 -5
- package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/module/ui/hooks/useAuthFetch.js +0 -212
- package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/module/ui/hooks/useOxyFollow.js +0 -186
- package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
- package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/module/ui/store/index.js +0 -33
- package/lib/module/ui/store/index.js.map +0 -1
- package/lib/module/ui/store/setupOxyStore.js +0 -59
- package/lib/module/ui/store/setupOxyStore.js.map +0 -1
- package/lib/module/ui/store/slices/authSlice.js +0 -48
- package/lib/module/ui/store/slices/authSlice.js.map +0 -1
- package/lib/module/ui/store/slices/followSlice.js +0 -232
- package/lib/module/ui/store/slices/followSlice.js.map +0 -1
- package/lib/module/ui/store/slices/index.js +0 -11
- package/lib/module/ui/store/slices/index.js.map +0 -1
- package/lib/module/ui/store/slices/types.js +0 -15
- package/lib/module/ui/store/slices/types.js.map +0 -1
- package/lib/module/ui/styles/shadows.js +0 -119
- package/lib/module/ui/styles/shadows.js.map +0 -1
- package/lib/module/utils/polyfills.js +0 -36
- package/lib/module/utils/polyfills.js.map +0 -1
- package/lib/typescript/types/react-redux.d.ts +0 -5
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
- package/lib/typescript/ui/store/index.d.ts +0 -27
- package/lib/typescript/ui/store/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
- package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
- package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
- package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/index.d.ts +0 -9
- package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/types.d.ts +0 -16
- package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
- package/lib/typescript/ui/styles/shadows.d.ts +0 -233
- package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
- package/lib/typescript/utils/polyfills.d.ts +0 -6
- package/lib/typescript/utils/polyfills.d.ts.map +0 -1
- package/src/__tests__/backend-middleware.test.ts +0 -209
- package/src/__tests__/polyfills.test.ts +0 -30
- package/src/__tests__/setup.ts +0 -43
- package/src/__tests__/ui/hooks/authfetch-integration.test.ts +0 -197
- package/src/__tests__/ui/hooks/backward-compatibility.test.ts +0 -159
- package/src/__tests__/ui/hooks/real-world-scenarios.test.ts +0 -224
- package/src/__tests__/ui/hooks/url-resolution.test.ts +0 -129
- package/src/__tests__/ui/hooks/useAuthFetch-separation.test.ts +0 -69
- package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
- package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
- package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
- package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
- package/src/__tests__/validate-structure.js +0 -91
- package/src/__tests__/validation.js +0 -42
- package/src/types/react-redux.d.ts +0 -5
- package/src/ui/components/bottomSheet/index.tsx +0 -14
- package/src/ui/hooks/useAuthFetch.ts +0 -238
- package/src/ui/hooks/useOxyFollow.ts +0 -188
- package/src/ui/screens/BillingManagementScreen.tsx +0 -589
- package/src/ui/store/index.ts +0 -36
- package/src/ui/store/setupOxyStore.ts +0 -58
- package/src/ui/store/slices/authSlice.ts +0 -43
- package/src/ui/store/slices/followSlice.ts +0 -207
- package/src/ui/store/slices/index.ts +0 -31
- package/src/ui/store/slices/types.ts +0 -33
- package/src/ui/styles/shadows.ts +0 -112
- package/src/utils/polyfills.ts +0 -34
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import type { User } from '../../../models/interfaces';
|
|
3
|
-
import type { AuthState } from './types';
|
|
4
|
-
import { initialAuthState } from './types';
|
|
5
|
-
|
|
6
|
-
export const authSlice = createSlice({
|
|
7
|
-
name: 'auth',
|
|
8
|
-
initialState: initialAuthState,
|
|
9
|
-
reducers: {
|
|
10
|
-
loginStart(state: AuthState) {
|
|
11
|
-
state.isLoading = true;
|
|
12
|
-
state.error = null;
|
|
13
|
-
},
|
|
14
|
-
loginSuccess(state: AuthState, action: PayloadAction<User>) {
|
|
15
|
-
state.isLoading = false;
|
|
16
|
-
state.isAuthenticated = true;
|
|
17
|
-
state.user = action.payload;
|
|
18
|
-
},
|
|
19
|
-
loginFailure(state: AuthState, action: PayloadAction<string>) {
|
|
20
|
-
state.isLoading = false;
|
|
21
|
-
state.error = action.payload;
|
|
22
|
-
},
|
|
23
|
-
logout(state: AuthState) {
|
|
24
|
-
state.user = null;
|
|
25
|
-
state.isAuthenticated = false;
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Export actions
|
|
31
|
-
export const authActions = authSlice.actions;
|
|
32
|
-
export const { loginStart, loginSuccess, loginFailure, logout } = authSlice.actions;
|
|
33
|
-
|
|
34
|
-
// Export selectors
|
|
35
|
-
export const authSelectors = {
|
|
36
|
-
selectUser: (state: { auth: AuthState }) => state.auth.user,
|
|
37
|
-
selectIsAuthenticated: (state: { auth: AuthState }) => state.auth.isAuthenticated,
|
|
38
|
-
selectIsLoading: (state: { auth: AuthState }) => state.auth.isLoading,
|
|
39
|
-
selectError: (state: { auth: AuthState }) => state.auth.error,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Export reducer
|
|
43
|
-
export const authReducer = authSlice.reducer;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { createSlice, PayloadAction, createAsyncThunk } from '@reduxjs/toolkit';
|
|
2
|
-
import type { FollowState } from './types';
|
|
3
|
-
import { initialFollowState } from './types';
|
|
4
|
-
|
|
5
|
-
// Define thunk state interface for dependency injection
|
|
6
|
-
interface RootState {
|
|
7
|
-
follow: FollowState;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Async thunk for fetching follow status from backend with deduplication
|
|
11
|
-
export const fetchFollowStatus = createAsyncThunk(
|
|
12
|
-
'follow/fetchFollowStatus',
|
|
13
|
-
async ({ userId, oxyServices }: { userId: string; oxyServices: any }, { rejectWithValue }) => {
|
|
14
|
-
try {
|
|
15
|
-
// Use the proper core service method
|
|
16
|
-
const response = await oxyServices.getFollowStatus(userId);
|
|
17
|
-
return { userId, isFollowing: response.isFollowing };
|
|
18
|
-
} catch (error: any) {
|
|
19
|
-
// Ignore authentication errors when user isn't signed in - don't update state
|
|
20
|
-
if (error?.status === 401 || error?.message?.includes('Authentication')) {
|
|
21
|
-
return rejectWithValue('Not authenticated');
|
|
22
|
-
}
|
|
23
|
-
// Log other failures and reject to not update state
|
|
24
|
-
console.warn(`Failed to fetch follow status for user ${userId}:`, error);
|
|
25
|
-
return rejectWithValue(error?.message || 'Failed to fetch follow status');
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
// Prevent duplicate requests for the same user ID
|
|
30
|
-
condition: ({ userId }, { getState }) => {
|
|
31
|
-
const state = getState() as RootState;
|
|
32
|
-
const isAlreadyFetching = state.follow.fetchingUsers[userId];
|
|
33
|
-
|
|
34
|
-
if (isAlreadyFetching) {
|
|
35
|
-
console.log(`⚡ Deduplicating fetch request for user ${userId} - already in progress`);
|
|
36
|
-
return false; // Cancel this request
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return true; // Allow this request
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// Async thunk for following/unfollowing users using core services
|
|
45
|
-
export const toggleFollowUser = createAsyncThunk(
|
|
46
|
-
'follow/toggleFollowUser',
|
|
47
|
-
async ({ userId, oxyServices, isCurrentlyFollowing }: {
|
|
48
|
-
userId: string;
|
|
49
|
-
oxyServices: any;
|
|
50
|
-
isCurrentlyFollowing: boolean;
|
|
51
|
-
}, { rejectWithValue, dispatch }) => {
|
|
52
|
-
try {
|
|
53
|
-
let response: { success?: boolean; message?: string; action?: string };
|
|
54
|
-
let newFollowState: boolean;
|
|
55
|
-
|
|
56
|
-
if (isCurrentlyFollowing) {
|
|
57
|
-
// Use the core service to unfollow user
|
|
58
|
-
response = await oxyServices.unfollowUser(userId);
|
|
59
|
-
newFollowState = false;
|
|
60
|
-
} else {
|
|
61
|
-
// Use the core service to follow user
|
|
62
|
-
response = await oxyServices.followUser(userId);
|
|
63
|
-
newFollowState = true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Check if the response indicates success (different APIs might return different formats)
|
|
67
|
-
const isSuccess = response.success !== false && response.action !== 'error';
|
|
68
|
-
|
|
69
|
-
if (isSuccess) {
|
|
70
|
-
return {
|
|
71
|
-
userId,
|
|
72
|
-
isFollowing: newFollowState,
|
|
73
|
-
message: response.message || `Successfully ${newFollowState ? 'followed' : 'unfollowed'} user`
|
|
74
|
-
};
|
|
75
|
-
} else {
|
|
76
|
-
return rejectWithValue(response.message || `Failed to ${newFollowState ? 'follow' : 'unfollow'} user`);
|
|
77
|
-
}
|
|
78
|
-
} catch (error: any) {
|
|
79
|
-
// Enhanced error handling with state mismatch detection
|
|
80
|
-
let errorMessage = 'Network error occurred';
|
|
81
|
-
|
|
82
|
-
if (error?.message) {
|
|
83
|
-
errorMessage = error.message;
|
|
84
|
-
} else if (error?.response?.data?.message) {
|
|
85
|
-
errorMessage = error.response.data.message;
|
|
86
|
-
} else if (error?.data?.message) {
|
|
87
|
-
errorMessage = error.data.message;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Handle state mismatch errors by syncing with backend
|
|
91
|
-
if (errorMessage.includes('Not following this user') && isCurrentlyFollowing) {
|
|
92
|
-
console.warn(`State mismatch detected for user ${userId}: Frontend thinks following, backend says not following. Syncing state...`);
|
|
93
|
-
// Auto-sync with backend state
|
|
94
|
-
try {
|
|
95
|
-
const actualStatus = await oxyServices.getFollowStatus(userId);
|
|
96
|
-
dispatch({ type: 'follow/setFollowingStatus', payload: { userId, isFollowing: actualStatus.isFollowing } });
|
|
97
|
-
return rejectWithValue('State synced with backend. Please try again.');
|
|
98
|
-
} catch (syncError) {
|
|
99
|
-
console.error('Failed to sync state with backend:', syncError);
|
|
100
|
-
}
|
|
101
|
-
} else if (errorMessage.includes('Already following this user') && !isCurrentlyFollowing) {
|
|
102
|
-
console.warn(`State mismatch detected for user ${userId}: Frontend thinks not following, backend says following. Syncing state...`);
|
|
103
|
-
// Auto-sync with backend state
|
|
104
|
-
try {
|
|
105
|
-
const actualStatus = await oxyServices.getFollowStatus(userId);
|
|
106
|
-
dispatch({ type: 'follow/setFollowingStatus', payload: { userId, isFollowing: actualStatus.isFollowing } });
|
|
107
|
-
return rejectWithValue('State synced with backend. Please try again.');
|
|
108
|
-
} catch (syncError) {
|
|
109
|
-
console.error('Failed to sync state with backend:', syncError);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return rejectWithValue(errorMessage);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
export const followSlice = createSlice({
|
|
119
|
-
name: 'follow',
|
|
120
|
-
initialState: initialFollowState,
|
|
121
|
-
reducers: {
|
|
122
|
-
setFollowingStatus(state: FollowState, action: PayloadAction<{ userId: string; isFollowing: boolean }>) {
|
|
123
|
-
const { userId, isFollowing } = action.payload;
|
|
124
|
-
state.followingUsers[userId] = isFollowing;
|
|
125
|
-
state.errors[userId] = null;
|
|
126
|
-
},
|
|
127
|
-
clearFollowError(state: FollowState, action: PayloadAction<string>) {
|
|
128
|
-
const userId = action.payload;
|
|
129
|
-
state.errors[userId] = null;
|
|
130
|
-
},
|
|
131
|
-
resetFollowState(state: FollowState) {
|
|
132
|
-
state.followingUsers = {};
|
|
133
|
-
state.loadingUsers = {};
|
|
134
|
-
state.fetchingUsers = {};
|
|
135
|
-
state.errors = {};
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
extraReducers: (builder) => {
|
|
139
|
-
builder
|
|
140
|
-
// Handle fetchFollowStatus
|
|
141
|
-
.addCase(fetchFollowStatus.pending, (state, action) => {
|
|
142
|
-
const { userId } = action.meta.arg;
|
|
143
|
-
state.fetchingUsers[userId] = true;
|
|
144
|
-
state.errors[userId] = null;
|
|
145
|
-
})
|
|
146
|
-
.addCase(fetchFollowStatus.fulfilled, (state, action) => {
|
|
147
|
-
const { userId, isFollowing } = action.payload;
|
|
148
|
-
state.followingUsers[userId] = isFollowing;
|
|
149
|
-
state.fetchingUsers[userId] = false;
|
|
150
|
-
state.errors[userId] = null;
|
|
151
|
-
})
|
|
152
|
-
.addCase(fetchFollowStatus.rejected, (state, action) => {
|
|
153
|
-
const { userId } = action.meta.arg;
|
|
154
|
-
state.fetchingUsers[userId] = false;
|
|
155
|
-
// Don't update follow state on fetch errors - preserve existing/initial state
|
|
156
|
-
if (action.payload !== 'Not authenticated') {
|
|
157
|
-
console.warn(`Failed to fetch follow status for user ${userId}:`, action.payload);
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
// Handle toggleFollowUser
|
|
161
|
-
.addCase(toggleFollowUser.pending, (state, action) => {
|
|
162
|
-
const { userId } = action.meta.arg;
|
|
163
|
-
state.loadingUsers[userId] = true;
|
|
164
|
-
state.errors[userId] = null;
|
|
165
|
-
})
|
|
166
|
-
.addCase(toggleFollowUser.fulfilled, (state, action) => {
|
|
167
|
-
const { userId, isFollowing } = action.payload;
|
|
168
|
-
state.followingUsers[userId] = isFollowing;
|
|
169
|
-
state.loadingUsers[userId] = false;
|
|
170
|
-
state.errors[userId] = null;
|
|
171
|
-
})
|
|
172
|
-
.addCase(toggleFollowUser.rejected, (state, action) => {
|
|
173
|
-
const { userId } = action.meta.arg;
|
|
174
|
-
state.loadingUsers[userId] = false;
|
|
175
|
-
state.errors[userId] = action.error.message || 'Failed to update follow status';
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// Export actions
|
|
181
|
-
export const followActions = followSlice.actions;
|
|
182
|
-
export const { setFollowingStatus, clearFollowError, resetFollowState } = followSlice.actions;
|
|
183
|
-
|
|
184
|
-
// Export thunks
|
|
185
|
-
export const followThunks = {
|
|
186
|
-
fetchFollowStatus,
|
|
187
|
-
toggleFollowUser,
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// Export selectors
|
|
191
|
-
export const followSelectors = {
|
|
192
|
-
selectFollowingUsers: (state: { follow: FollowState }) => state.follow.followingUsers,
|
|
193
|
-
selectLoadingUsers: (state: { follow: FollowState }) => state.follow.loadingUsers,
|
|
194
|
-
selectFetchingUsers: (state: { follow: FollowState }) => state.follow.fetchingUsers,
|
|
195
|
-
selectFollowErrors: (state: { follow: FollowState }) => state.follow.errors,
|
|
196
|
-
selectIsUserFollowed: (state: { follow: FollowState }, userId: string) =>
|
|
197
|
-
state.follow.followingUsers[userId] ?? false,
|
|
198
|
-
selectIsUserLoading: (state: { follow: FollowState }, userId: string) =>
|
|
199
|
-
state.follow.loadingUsers[userId] ?? false,
|
|
200
|
-
selectIsUserBeingFetched: (state: { follow: FollowState }, userId: string) =>
|
|
201
|
-
state.follow.fetchingUsers[userId] ?? false,
|
|
202
|
-
selectUserError: (state: { follow: FollowState }, userId: string) =>
|
|
203
|
-
state.follow.errors[userId] ?? null,
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
// Export reducer
|
|
207
|
-
export const followReducer = followSlice.reducer;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redux slices exports
|
|
3
|
-
* This file exports individual slices and their components for tree-shaking
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
authSlice,
|
|
8
|
-
authActions,
|
|
9
|
-
authSelectors,
|
|
10
|
-
authReducer,
|
|
11
|
-
loginStart,
|
|
12
|
-
loginSuccess,
|
|
13
|
-
loginFailure,
|
|
14
|
-
logout
|
|
15
|
-
} from './authSlice';
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
followSlice,
|
|
19
|
-
followActions,
|
|
20
|
-
followSelectors,
|
|
21
|
-
followThunks,
|
|
22
|
-
followReducer,
|
|
23
|
-
setFollowingStatus,
|
|
24
|
-
clearFollowError,
|
|
25
|
-
resetFollowState,
|
|
26
|
-
fetchFollowStatus,
|
|
27
|
-
toggleFollowUser
|
|
28
|
-
} from './followSlice';
|
|
29
|
-
|
|
30
|
-
export type { AuthState, FollowState } from './types';
|
|
31
|
-
export { initialAuthState, initialFollowState } from './types';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { User } from '../../../models/interfaces';
|
|
2
|
-
|
|
3
|
-
export interface AuthState {
|
|
4
|
-
user: User | null;
|
|
5
|
-
isAuthenticated: boolean;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
error: string | null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface FollowState {
|
|
11
|
-
// Track follow status for each user ID
|
|
12
|
-
followingUsers: Record<string, boolean>;
|
|
13
|
-
// Track loading state for each user ID
|
|
14
|
-
loadingUsers: Record<string, boolean>;
|
|
15
|
-
// Track which user IDs are currently being fetched (to prevent duplicate requests)
|
|
16
|
-
fetchingUsers: Record<string, boolean>;
|
|
17
|
-
// Track any follow/unfollow errors
|
|
18
|
-
errors: Record<string, string | null>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const initialAuthState: AuthState = {
|
|
22
|
-
user: null,
|
|
23
|
-
isAuthenticated: false,
|
|
24
|
-
isLoading: false,
|
|
25
|
-
error: null,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const initialFollowState: FollowState = {
|
|
29
|
-
followingUsers: {},
|
|
30
|
-
loadingUsers: {},
|
|
31
|
-
fetchingUsers: {},
|
|
32
|
-
errors: {},
|
|
33
|
-
};
|
package/src/ui/styles/shadows.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Cross-platform shadow utility that eliminates "shadow*" deprecation warnings
|
|
5
|
-
*/
|
|
6
|
-
export interface ShadowConfig {
|
|
7
|
-
shadowColor?: string;
|
|
8
|
-
shadowOffset?: { width: number; height: number };
|
|
9
|
-
shadowOpacity?: number;
|
|
10
|
-
shadowRadius?: number;
|
|
11
|
-
elevation?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Creates cross-platform shadow styles
|
|
16
|
-
* Uses boxShadow for web and native shadow props for iOS/Android
|
|
17
|
-
*/
|
|
18
|
-
export function createShadow(config: ShadowConfig) {
|
|
19
|
-
const {
|
|
20
|
-
shadowColor = '#000',
|
|
21
|
-
shadowOffset = { width: 0, height: 2 },
|
|
22
|
-
shadowOpacity = 0.1,
|
|
23
|
-
shadowRadius = 4,
|
|
24
|
-
elevation = 2,
|
|
25
|
-
} = config;
|
|
26
|
-
|
|
27
|
-
return Platform.select({
|
|
28
|
-
web: {
|
|
29
|
-
boxShadow: `${shadowOffset.width}px ${shadowOffset.height}px ${shadowRadius}px rgba(${hexToRgb(shadowColor)}, ${shadowOpacity})`,
|
|
30
|
-
},
|
|
31
|
-
ios: {
|
|
32
|
-
shadowColor,
|
|
33
|
-
shadowOffset,
|
|
34
|
-
shadowOpacity,
|
|
35
|
-
shadowRadius,
|
|
36
|
-
},
|
|
37
|
-
android: {
|
|
38
|
-
elevation,
|
|
39
|
-
},
|
|
40
|
-
default: {
|
|
41
|
-
shadowColor,
|
|
42
|
-
shadowOffset,
|
|
43
|
-
shadowOpacity,
|
|
44
|
-
shadowRadius,
|
|
45
|
-
elevation,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Helper function to convert hex color to RGB
|
|
52
|
-
*/
|
|
53
|
-
function hexToRgb(hex: string): string {
|
|
54
|
-
// Remove # if present
|
|
55
|
-
hex = hex.replace('#', '');
|
|
56
|
-
|
|
57
|
-
// Handle shorthand hex colors (e.g., #fff)
|
|
58
|
-
if (hex.length === 3) {
|
|
59
|
-
hex = hex.split('').map(char => char + char).join('');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const r = parseInt(hex.substr(0, 2), 16);
|
|
63
|
-
const g = parseInt(hex.substr(2, 2), 16);
|
|
64
|
-
const b = parseInt(hex.substr(4, 2), 16);
|
|
65
|
-
|
|
66
|
-
return `${r}, ${g}, ${b}`;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Predefined shadow presets
|
|
71
|
-
*/
|
|
72
|
-
export const shadows = {
|
|
73
|
-
small: createShadow({
|
|
74
|
-
shadowColor: '#000',
|
|
75
|
-
shadowOffset: { width: 0, height: 1 },
|
|
76
|
-
shadowOpacity: 0.05,
|
|
77
|
-
shadowRadius: 2,
|
|
78
|
-
elevation: 1,
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
medium: createShadow({
|
|
82
|
-
shadowColor: '#000',
|
|
83
|
-
shadowOffset: { width: 0, height: 2 },
|
|
84
|
-
shadowOpacity: 0.1,
|
|
85
|
-
shadowRadius: 4,
|
|
86
|
-
elevation: 2,
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
large: createShadow({
|
|
90
|
-
shadowColor: '#000',
|
|
91
|
-
shadowOffset: { width: 0, height: 4 },
|
|
92
|
-
shadowOpacity: 0.15,
|
|
93
|
-
shadowRadius: 8,
|
|
94
|
-
elevation: 4,
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
card: createShadow({
|
|
98
|
-
shadowColor: '#000',
|
|
99
|
-
shadowOffset: { width: 0, height: 2 },
|
|
100
|
-
shadowOpacity: 0.08,
|
|
101
|
-
shadowRadius: 8,
|
|
102
|
-
elevation: 3,
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
button: createShadow({
|
|
106
|
-
shadowColor: '#000',
|
|
107
|
-
shadowOffset: { width: 0, height: 2 },
|
|
108
|
-
shadowOpacity: 0.1,
|
|
109
|
-
shadowRadius: 4,
|
|
110
|
-
elevation: 2,
|
|
111
|
-
}),
|
|
112
|
-
};
|
package/src/utils/polyfills.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Polyfills for React Native environments that may be missing certain Web APIs
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// FormData polyfill for React Native/Hermes environments
|
|
6
|
-
if (typeof FormData === 'undefined') {
|
|
7
|
-
try {
|
|
8
|
-
const FormDataPolyfill = require('form-data');
|
|
9
|
-
// Use globalThis which is more universal than global
|
|
10
|
-
if (typeof globalThis !== 'undefined') {
|
|
11
|
-
(globalThis as any).FormData = FormDataPolyfill;
|
|
12
|
-
}
|
|
13
|
-
} catch (error) {
|
|
14
|
-
console.warn('form-data package not found. File uploads may not work in React Native environments without native FormData support.');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Export a helper to ensure FormData is available
|
|
19
|
-
export const ensureFormDataAvailable = (): boolean => {
|
|
20
|
-
return typeof FormData !== 'undefined' || typeof require !== 'undefined';
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Get FormData constructor (either native or polyfilled)
|
|
24
|
-
export const getFormDataConstructor = (): any => {
|
|
25
|
-
if (typeof FormData !== 'undefined') {
|
|
26
|
-
return FormData;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
return require('form-data');
|
|
31
|
-
} catch (error) {
|
|
32
|
-
throw new Error('FormData is not available and form-data package is not installed. Please install form-data for file upload support.');
|
|
33
|
-
}
|
|
34
|
-
};
|