@oxyhq/services 5.10.16 → 5.11.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 +78 -14
- package/lib/commonjs/assets/assets/icons/OxyServices.tsx +2 -2
- package/lib/commonjs/assets/assets/illustrations/HighFive.tsx +1 -1
- package/lib/commonjs/assets/icons/OxyServices.js +0 -2
- package/lib/commonjs/assets/icons/OxyServices.js.map +1 -1
- package/lib/commonjs/assets/illustrations/HighFive.js +0 -2
- package/lib/commonjs/assets/illustrations/HighFive.js.map +1 -1
- package/lib/commonjs/core/OxyServices.js +238 -25
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/index.js +86 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner-safe.js +2 -0
- package/lib/commonjs/lib/sonner-safe.js.map +1 -1
- package/lib/commonjs/lib/sonner.js +2 -0
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +0 -2
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +4 -4
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +3 -2
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +7 -4
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +0 -1
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyLogo.js +0 -2
- package/lib/commonjs/ui/components/OxyLogo.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +4 -5
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -3
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +0 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +0 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/QuickActions.js +0 -2
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +0 -1
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +0 -2
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +0 -2
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -1
- package/lib/commonjs/ui/components/icon/OxyIcon.js +0 -2
- package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +0 -2
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +4 -3
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +3 -3
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js +263 -0
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +1 -2
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +0 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +5 -6
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -2
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +631 -430
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -2
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -2
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +1 -2
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +1 -2
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +1 -2
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +0 -2
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +0 -1
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +0 -1
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +0 -2
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +0 -2
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/assetStore.js +225 -0
- package/lib/commonjs/ui/stores/assetStore.js.map +1 -0
- package/lib/commonjs/ui/stores/authStore.js +1 -1
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/fileStore.js +153 -0
- package/lib/commonjs/ui/stores/fileStore.js.map +1 -0
- package/lib/commonjs/ui/stores/followStore.js +2 -2
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/utils/asyncUtils.js +1 -1
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/errorUtils.js +19 -11
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/utils/hookUtils.js +1 -1
- package/lib/commonjs/utils/hookUtils.js.map +1 -1
- package/lib/commonjs/utils/loggerUtils.js.map +1 -1
- package/lib/commonjs/utils/validationUtils.js +2 -2
- package/lib/commonjs/utils/validationUtils.js.map +1 -1
- package/lib/module/assets/assets/icons/OxyServices.tsx +2 -2
- package/lib/module/assets/assets/illustrations/HighFive.tsx +1 -1
- package/lib/module/assets/icons/OxyServices.js +0 -1
- package/lib/module/assets/icons/OxyServices.js.map +1 -1
- package/lib/module/assets/illustrations/HighFive.js +0 -1
- package/lib/module/assets/illustrations/HighFive.js.map +1 -1
- package/lib/module/core/OxyServices.js +238 -25
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner-safe.js +2 -0
- package/lib/module/lib/sonner-safe.js.map +1 -1
- package/lib/module/lib/sonner.js +3 -0
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +0 -1
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +4 -3
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +3 -2
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +7 -3
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +1 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +0 -1
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyLogo.js +0 -1
- package/lib/module/ui/components/OxyLogo.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +4 -4
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -2
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +0 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +0 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +0 -1
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +0 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +0 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +0 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -1
- package/lib/module/ui/components/icon/OxyIcon.js +0 -1
- package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +0 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +4 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +3 -3
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js +257 -0
- package/lib/module/ui/hooks/useAssets.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +1 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +0 -1
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +0 -1
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +5 -5
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +633 -432
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +1 -1
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +0 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js +0 -1
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +0 -1
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +0 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +0 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/assetStore.js +212 -0
- package/lib/module/ui/stores/assetStore.js.map +1 -0
- package/lib/module/ui/stores/authStore.js +1 -1
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/fileStore.js +145 -0
- package/lib/module/ui/stores/fileStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +2 -2
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/styles/fonts.js.map +1 -1
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/utils/asyncUtils.js +1 -1
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/errorUtils.js +19 -11
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/module/utils/hookUtils.js +1 -1
- package/lib/module/utils/hookUtils.js.map +1 -1
- package/lib/module/utils/loggerUtils.js.map +1 -1
- package/lib/module/utils/validationUtils.js +2 -2
- package/lib/module/utils/validationUtils.js.map +1 -1
- package/lib/typescript/assets/icons/OxyServices.d.ts +2 -2
- package/lib/typescript/assets/icons/OxyServices.d.ts.map +1 -1
- package/lib/typescript/assets/illustrations/HighFive.d.ts +1 -1
- package/lib/typescript/assets/illustrations/HighFive.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +68 -12
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/sonner-safe.d.ts +2 -1
- package/lib/typescript/lib/sonner-safe.d.ts.map +1 -1
- package/lib/typescript/lib/sonner.d.ts +11 -3
- package/lib/typescript/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +105 -6
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/types/expo-vector-icons.d.ts +8 -1
- package/lib/typescript/types/express.d.ts +22 -3
- package/lib/typescript/ui/components/Avatar.d.ts +2 -2
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +2 -2
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +2 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +2 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +1 -1
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyLogo.d.ts +2 -2
- package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +2 -2
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts +2 -2
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts +1 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +3 -3
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAssets.d.ts +35 -0
- package/lib/typescript/ui/hooks/useAssets.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +2 -2
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +7 -7
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/assetStore.d.ts +54 -0
- package/lib/typescript/ui/stores/assetStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/fileStore.d.ts +31 -0
- package/lib/typescript/ui/stores/fileStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/followStore.d.ts +1 -1
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/fonts.d.ts +1 -1
- package/lib/typescript/ui/styles/fonts.d.ts.map +1 -1
- package/lib/typescript/ui/styles/theme.d.ts +1 -1
- package/lib/typescript/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/errorUtils.d.ts +5 -5
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
- package/lib/typescript/utils/hookUtils.d.ts +4 -4
- package/lib/typescript/utils/hookUtils.d.ts.map +1 -1
- package/lib/typescript/utils/loggerUtils.d.ts +18 -18
- package/lib/typescript/utils/loggerUtils.d.ts.map +1 -1
- package/lib/typescript/utils/validationUtils.d.ts +6 -6
- package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
- package/package.json +149 -143
- package/src/assets/icons/OxyServices.tsx +2 -2
- package/src/assets/illustrations/HighFive.tsx +1 -1
- package/src/core/OxyServices.ts +264 -40
- package/src/core/__tests__/OxyServices.test.ts +180 -0
- package/src/index.ts +15 -1
- package/src/lib/sonner-safe.ts +4 -1
- package/src/lib/sonner.ts +19 -2
- package/src/models/interfaces.ts +117 -6
- package/src/types/expo-vector-icons.d.ts +8 -1
- package/src/types/express.d.ts +22 -3
- package/src/ui/components/Avatar.tsx +2 -2
- package/src/ui/components/FollowButton.tsx +10 -8
- package/src/ui/components/FontLoader.tsx +5 -3
- package/src/ui/components/GroupedItem.tsx +12 -2
- package/src/ui/components/GroupedSection.tsx +3 -1
- package/src/ui/components/Header.tsx +1 -1
- package/src/ui/components/OxyLogo.tsx +2 -2
- package/src/ui/components/OxyPayButton.tsx +6 -5
- package/src/ui/components/OxyProvider.tsx +7 -4
- package/src/ui/components/OxySignInButton.tsx +2 -2
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/QuickActions.tsx +1 -1
- package/src/ui/components/Section.tsx +1 -1
- package/src/ui/components/SectionTitle.tsx +1 -1
- package/src/ui/components/icon/FAIRWalletIcon.tsx +1 -1
- package/src/ui/components/icon/OxyIcon.tsx +1 -1
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/PinInput.tsx +3 -2
- package/src/ui/components/internal/TextField.tsx +9 -11
- package/src/ui/context/OxyContext.tsx +3 -3
- package/src/ui/hooks/useAssets.ts +306 -0
- package/src/ui/navigation/OxyRouter.tsx +3 -2
- package/src/ui/navigation/types.ts +8 -8
- package/src/ui/screens/AccountCenterScreen.tsx +2 -2
- package/src/ui/screens/AccountManagementDemo.tsx +1 -1
- package/src/ui/screens/AccountOverviewScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +3 -3
- package/src/ui/screens/AccountSwitcherScreen.tsx +9 -8
- package/src/ui/screens/AppInfoScreen.tsx +3 -2
- package/src/ui/screens/FeedbackScreen.tsx +1 -1
- package/src/ui/screens/FileManagementScreen.tsx +619 -494
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +3 -2
- package/src/ui/screens/ProfileScreen.tsx +3 -2
- package/src/ui/screens/RecoverAccountScreen.tsx +3 -2
- package/src/ui/screens/SessionManagementScreen.tsx +4 -3
- package/src/ui/screens/SignInScreen.tsx +3 -2
- package/src/ui/screens/SignUpScreen.tsx +1 -1
- package/src/ui/screens/UserLinksScreen.tsx +2 -2
- package/src/ui/screens/internal/SignInPasswordStep.tsx +3 -2
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpSummaryStep.tsx +1 -1
- package/src/ui/screens/internal/SignUpWelcomeStep.tsx +1 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +3 -2
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +3 -2
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +3 -2
- package/src/ui/stores/assetStore.ts +281 -0
- package/src/ui/stores/authStore.ts +1 -1
- package/src/ui/stores/fileStore.ts +118 -0
- package/src/ui/stores/followStore.ts +4 -4
- package/src/ui/styles/fonts.ts +1 -1
- package/src/ui/styles/theme.ts +1 -1
- package/src/utils/__tests__/validationUtils.test.ts +236 -0
- package/src/utils/asyncUtils.ts +4 -4
- package/src/utils/errorUtils.ts +35 -23
- package/src/utils/hookUtils.ts +7 -7
- package/src/utils/loggerUtils.ts +18 -18
- package/src/utils/validationUtils.ts +8 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
Clipboard,
|
|
16
17
|
useWindowDimensions,
|
|
17
18
|
} from 'react-native';
|
|
18
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
19
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
19
20
|
import { fontFamilies, useThemeColors, createCommonStyles } from '../styles';
|
|
20
21
|
import OxyLogo from '../components/OxyLogo';
|
|
21
22
|
import GroupedPillButtons from '../components/internal/GroupedPillButtons';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
Animated,
|
|
12
13
|
Dimensions,
|
|
13
14
|
} from 'react-native';
|
|
14
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
15
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
15
16
|
import { useOxy } from '../context/OxyContext';
|
|
16
17
|
import { fontFamilies } from '../styles/fonts';
|
|
17
18
|
import { toast } from '../../lib/sonner';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { View, Text, StyleSheet, ActivityIndicator, ScrollView, TouchableOpacity, Image } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
4
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
4
5
|
import { useOxy } from '../context/OxyContext';
|
|
5
6
|
import Avatar from '../components/Avatar';
|
|
6
7
|
import { FollowButton } from '../components';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useRef, useCallback } from 'react';
|
|
3
|
+
import { View, Text, Animated, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, StatusBar, type TextInput } from 'react-native';
|
|
3
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
5
|
import TextField from '../components/internal/TextField';
|
|
5
6
|
import GroupedPillButtons from '../components/internal/GroupedPillButtons';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -10,13 +11,13 @@ import {
|
|
|
10
11
|
Platform,
|
|
11
12
|
RefreshControl,
|
|
12
13
|
} from 'react-native';
|
|
13
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
14
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
14
15
|
import { useOxy } from '../context/OxyContext';
|
|
15
16
|
import { fontFamilies } from '../styles/fonts';
|
|
16
17
|
import { toast } from '../../lib/sonner';
|
|
17
18
|
import { Ionicons } from '@expo/vector-icons';
|
|
18
19
|
import OxyIcon from '../components/icon/OxyIcon';
|
|
19
|
-
import { ClientSession } from '../../models/session';
|
|
20
|
+
import type { ClientSession } from '../../models/session';
|
|
20
21
|
import { confirmAction } from '../utils/confirmAction';
|
|
21
22
|
import { Header } from '../components';
|
|
22
23
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
StatusBar,
|
|
16
17
|
Alert,
|
|
17
18
|
} from 'react-native';
|
|
18
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
19
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
19
20
|
import { useOxy } from '../context/OxyContext';
|
|
20
21
|
import { fontFamilies, useThemeColors, createCommonStyles, createAuthStyles } from '../styles';
|
|
21
22
|
import OxyLogo from '../components/OxyLogo';
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
StatusBar,
|
|
14
14
|
Alert,
|
|
15
15
|
} from 'react-native';
|
|
16
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
16
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
17
17
|
import { useOxy } from '../context/OxyContext';
|
|
18
18
|
import { useThemeColors, createCommonStyles, createAuthStyles } from '../styles';
|
|
19
19
|
import { Ionicons } from '@expo/vector-icons';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, Linking } from 'react-native';
|
|
3
3
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
4
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
5
5
|
import { Header, GroupedSection } from '../components';
|
|
6
6
|
|
|
7
7
|
interface UserLinksScreenProps extends BaseScreenProps {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { View, Text, Animated, TouchableOpacity, type TextInput, StatusBar } from 'react-native';
|
|
3
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
5
|
import Avatar from '../../components/Avatar';
|
|
5
6
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { type TextInput, View, Text, Animated } from 'react-native';
|
|
3
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
5
|
import HighFive from '../../../assets/illustrations/HighFive';
|
|
5
6
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { View, Text, Animated, TouchableOpacity, type TextInput } from 'react-native';
|
|
3
4
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
4
5
|
import TextField from '../../components/internal/TextField';
|
|
5
6
|
import HighFive from '../../../assets/illustrations/HighFive';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { View, Text, Animated, type TextInput } from 'react-native';
|
|
3
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
5
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
5
6
|
import TextField from '../../components/internal/TextField';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Platform } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
3
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
4
4
|
import { Header } from '../../components';
|
|
5
5
|
|
|
6
6
|
const KarmaAboutScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
Alert,
|
|
10
11
|
Platform,
|
|
11
12
|
} from 'react-native';
|
|
12
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
13
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
13
14
|
import { useOxy } from '../../context/OxyContext';
|
|
14
15
|
import { fontFamilies } from '../../styles/fonts';
|
|
15
16
|
import Avatar from '../../components/Avatar';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useMemo, useCallback } from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Platform, TouchableOpacity, TextInput, LayoutAnimation, UIManager } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
3
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
4
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
5
5
|
import { Header } from '../../components';
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { View, Text, StyleSheet, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
4
5
|
import { useOxy } from '../../context/OxyContext';
|
|
5
6
|
import Avatar from '../../components/Avatar';
|
|
6
7
|
import { Header } from '../../components';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Platform } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
3
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
4
4
|
import { Header } from '../../components';
|
|
5
5
|
|
|
6
6
|
const KarmaRewardsScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { View, Text, StyleSheet, ScrollView, ActivityIndicator } from 'react-native';
|
|
3
|
-
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
import type { BaseScreenProps } from '../../navigation/types';
|
|
4
5
|
import { useOxy } from '../../context/OxyContext';
|
|
5
6
|
import { Header } from '../../components';
|
|
6
7
|
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { Asset, AssetUploadProgress, AssetLink } from '../../models/interfaces';
|
|
3
|
+
|
|
4
|
+
interface AssetState {
|
|
5
|
+
// Asset data
|
|
6
|
+
assets: Record<string, Asset>;
|
|
7
|
+
uploadProgress: Record<string, AssetUploadProgress>;
|
|
8
|
+
|
|
9
|
+
// Loading states
|
|
10
|
+
loading: {
|
|
11
|
+
uploading: boolean;
|
|
12
|
+
linking: boolean;
|
|
13
|
+
deleting: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Error states
|
|
17
|
+
errors: {
|
|
18
|
+
upload?: string;
|
|
19
|
+
link?: string;
|
|
20
|
+
delete?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Actions
|
|
24
|
+
setAsset: (asset: Asset) => void;
|
|
25
|
+
setAssets: (assets: Asset[]) => void;
|
|
26
|
+
removeAsset: (assetId: string) => void;
|
|
27
|
+
|
|
28
|
+
// Upload progress actions
|
|
29
|
+
setUploadProgress: (fileId: string, progress: AssetUploadProgress) => void;
|
|
30
|
+
removeUploadProgress: (fileId: string) => void;
|
|
31
|
+
|
|
32
|
+
// Link management
|
|
33
|
+
addLink: (assetId: string, link: AssetLink) => void;
|
|
34
|
+
removeLink: (assetId: string, app: string, entityType: string, entityId: string) => void;
|
|
35
|
+
|
|
36
|
+
// Loading states
|
|
37
|
+
setUploading: (uploading: boolean) => void;
|
|
38
|
+
setLinking: (linking: boolean) => void;
|
|
39
|
+
setDeleting: (deleting: boolean) => void;
|
|
40
|
+
|
|
41
|
+
// Error management
|
|
42
|
+
setUploadError: (error?: string) => void;
|
|
43
|
+
setLinkError: (error?: string) => void;
|
|
44
|
+
setDeleteError: (error?: string) => void;
|
|
45
|
+
clearErrors: () => void;
|
|
46
|
+
|
|
47
|
+
// Utility methods
|
|
48
|
+
getAssetsByApp: (app: string) => Asset[];
|
|
49
|
+
getAssetsByEntity: (app: string, entityType: string, entityId: string) => Asset[];
|
|
50
|
+
getAssetUsageCount: (assetId: string) => number;
|
|
51
|
+
isAssetLinked: (assetId: string, app: string, entityType: string, entityId: string) => boolean;
|
|
52
|
+
|
|
53
|
+
// Reset store
|
|
54
|
+
reset: () => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const initialState = {
|
|
58
|
+
assets: {},
|
|
59
|
+
uploadProgress: {},
|
|
60
|
+
loading: {
|
|
61
|
+
uploading: false,
|
|
62
|
+
linking: false,
|
|
63
|
+
deleting: false,
|
|
64
|
+
},
|
|
65
|
+
errors: {},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const useAssetStore = create<AssetState>((set, get) => ({
|
|
69
|
+
...initialState,
|
|
70
|
+
|
|
71
|
+
// Asset management
|
|
72
|
+
setAsset: (asset: Asset) => {
|
|
73
|
+
set((state) => ({
|
|
74
|
+
assets: {
|
|
75
|
+
...state.assets,
|
|
76
|
+
[asset.id]: asset,
|
|
77
|
+
},
|
|
78
|
+
}));
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
setAssets: (assets: Asset[]) => {
|
|
82
|
+
set((state) => {
|
|
83
|
+
const assetMap = assets.reduce((acc, asset) => {
|
|
84
|
+
acc[asset.id] = asset;
|
|
85
|
+
return acc;
|
|
86
|
+
}, {} as Record<string, Asset>);
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
assets: {
|
|
90
|
+
...state.assets,
|
|
91
|
+
...assetMap,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
removeAsset: (assetId: string) => {
|
|
98
|
+
set((state) => {
|
|
99
|
+
const { [assetId]: removed, ...rest } = state.assets;
|
|
100
|
+
return { assets: rest };
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
// Upload progress
|
|
105
|
+
setUploadProgress: (fileId: string, progress: AssetUploadProgress) => {
|
|
106
|
+
set((state) => ({
|
|
107
|
+
uploadProgress: {
|
|
108
|
+
...state.uploadProgress,
|
|
109
|
+
[fileId]: progress,
|
|
110
|
+
},
|
|
111
|
+
}));
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
removeUploadProgress: (fileId: string) => {
|
|
115
|
+
set((state) => {
|
|
116
|
+
const { [fileId]: removed, ...rest } = state.uploadProgress;
|
|
117
|
+
return { uploadProgress: rest };
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
// Link management
|
|
122
|
+
addLink: (assetId: string, link: AssetLink) => {
|
|
123
|
+
set((state) => {
|
|
124
|
+
const asset = state.assets[assetId];
|
|
125
|
+
if (!asset) return state;
|
|
126
|
+
|
|
127
|
+
// Check if link already exists
|
|
128
|
+
const existingLink = asset.links.find(
|
|
129
|
+
(l: AssetLink) => l.app === link.app &&
|
|
130
|
+
l.entityType === link.entityType &&
|
|
131
|
+
l.entityId === link.entityId
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
if (existingLink) return state;
|
|
135
|
+
|
|
136
|
+
const updatedAsset = {
|
|
137
|
+
...asset,
|
|
138
|
+
links: [...asset.links, link],
|
|
139
|
+
usageCount: asset.links.length + 1,
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
assets: {
|
|
144
|
+
...state.assets,
|
|
145
|
+
[assetId]: updatedAsset,
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
removeLink: (assetId: string, app: string, entityType: string, entityId: string) => {
|
|
152
|
+
set((state) => {
|
|
153
|
+
const asset = state.assets[assetId];
|
|
154
|
+
if (!asset) return state;
|
|
155
|
+
|
|
156
|
+
const filteredLinks = asset.links.filter(
|
|
157
|
+
(link: AssetLink) => !(link.app === app &&
|
|
158
|
+
link.entityType === entityType &&
|
|
159
|
+
link.entityId === entityId)
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const updatedAsset = {
|
|
163
|
+
...asset,
|
|
164
|
+
links: filteredLinks,
|
|
165
|
+
usageCount: filteredLinks.length,
|
|
166
|
+
status: filteredLinks.length === 0 ? 'trash' as const : asset.status,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
assets: {
|
|
171
|
+
...state.assets,
|
|
172
|
+
[assetId]: updatedAsset,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
// Loading states
|
|
179
|
+
setUploading: (uploading: boolean) => {
|
|
180
|
+
set((state) => ({
|
|
181
|
+
loading: { ...state.loading, uploading },
|
|
182
|
+
}));
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
setLinking: (linking: boolean) => {
|
|
186
|
+
set((state) => ({
|
|
187
|
+
loading: { ...state.loading, linking },
|
|
188
|
+
}));
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
setDeleting: (deleting: boolean) => {
|
|
192
|
+
set((state) => ({
|
|
193
|
+
loading: { ...state.loading, deleting },
|
|
194
|
+
}));
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
// Error management
|
|
198
|
+
setUploadError: (error?: string) => {
|
|
199
|
+
set((state) => ({
|
|
200
|
+
errors: { ...state.errors, upload: error },
|
|
201
|
+
}));
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
setLinkError: (error?: string) => {
|
|
205
|
+
set((state) => ({
|
|
206
|
+
errors: { ...state.errors, link: error },
|
|
207
|
+
}));
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
setDeleteError: (error?: string) => {
|
|
211
|
+
set((state) => ({
|
|
212
|
+
errors: { ...state.errors, delete: error },
|
|
213
|
+
}));
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
clearErrors: () => {
|
|
217
|
+
set({ errors: {} });
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
// Utility methods
|
|
221
|
+
getAssetsByApp: (app: string) => {
|
|
222
|
+
const { assets } = get();
|
|
223
|
+
return Object.values(assets).filter((asset) =>
|
|
224
|
+
asset.links.some((link: AssetLink) => link.app === app)
|
|
225
|
+
);
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
getAssetsByEntity: (app: string, entityType: string, entityId: string) => {
|
|
229
|
+
const { assets } = get();
|
|
230
|
+
return Object.values(assets).filter((asset) =>
|
|
231
|
+
asset.links.some(
|
|
232
|
+
(link: AssetLink) => link.app === app &&
|
|
233
|
+
link.entityType === entityType &&
|
|
234
|
+
link.entityId === entityId
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
getAssetUsageCount: (assetId: string) => {
|
|
240
|
+
const { assets } = get();
|
|
241
|
+
const asset = assets[assetId];
|
|
242
|
+
return asset ? asset.usageCount : 0;
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
isAssetLinked: (assetId: string, app: string, entityType: string, entityId: string) => {
|
|
246
|
+
const { assets } = get();
|
|
247
|
+
const asset = assets[assetId];
|
|
248
|
+
if (!asset) return false;
|
|
249
|
+
|
|
250
|
+
return asset.links.some(
|
|
251
|
+
(link: AssetLink) => link.app === app &&
|
|
252
|
+
link.entityType === entityType &&
|
|
253
|
+
link.entityId === entityId
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
// Reset store
|
|
258
|
+
reset: () => {
|
|
259
|
+
set(initialState);
|
|
260
|
+
},
|
|
261
|
+
}));
|
|
262
|
+
|
|
263
|
+
// Selector hooks for convenience
|
|
264
|
+
export const useAssets = () => useAssetStore((state) => Object.values(state.assets));
|
|
265
|
+
export const useAsset = (assetId: string) => useAssetStore((state) => state.assets[assetId]);
|
|
266
|
+
export const useUploadProgress = () => useAssetStore((state) => state.uploadProgress);
|
|
267
|
+
export const useAssetLoading = () => useAssetStore((state) => state.loading);
|
|
268
|
+
export const useAssetErrors = () => useAssetStore((state) => state.errors);
|
|
269
|
+
|
|
270
|
+
// Typed selectors for specific use cases
|
|
271
|
+
export const useAssetsByApp = (app: string) =>
|
|
272
|
+
useAssetStore((state) => state.getAssetsByApp(app));
|
|
273
|
+
|
|
274
|
+
export const useAssetsByEntity = (app: string, entityType: string, entityId: string) =>
|
|
275
|
+
useAssetStore((state) => state.getAssetsByEntity(app, entityType, entityId));
|
|
276
|
+
|
|
277
|
+
export const useAssetUsageCount = (assetId: string) =>
|
|
278
|
+
useAssetStore((state) => state.getAssetUsageCount(assetId));
|
|
279
|
+
|
|
280
|
+
export const useIsAssetLinked = (assetId: string, app: string, entityType: string, entityId: string) =>
|
|
281
|
+
useAssetStore((state) => state.isAssetLinked(assetId, app, entityType, entityId));
|
|
@@ -30,7 +30,7 @@ export const useAuthStore = create<AuthState>((set: (state: Partial<AuthState>)
|
|
|
30
30
|
fetchUser: async (oxyServices, forceRefresh = false) => {
|
|
31
31
|
const state = get();
|
|
32
32
|
const now = Date.now();
|
|
33
|
-
const cacheAge = state.lastUserFetch ? now - state.lastUserFetch :
|
|
33
|
+
const cacheAge = state.lastUserFetch ? now - state.lastUserFetch : Number.POSITIVE_INFINITY;
|
|
34
34
|
const cacheValid = cacheAge < 5 * 60 * 1000; // 5 minutes cache
|
|
35
35
|
|
|
36
36
|
// Use cached data if available and not forcing refresh
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { shallow } from 'zustand/shallow';
|
|
3
|
+
import type { FileMetadata } from '../../models/interfaces';
|
|
4
|
+
// Shallow compare two file metadata objects by keys/values
|
|
5
|
+
function shallowEqualFile(a: FileMetadata, b: FileMetadata): boolean {
|
|
6
|
+
if (a === b) return true;
|
|
7
|
+
if (!a || !b) return false;
|
|
8
|
+
const aKeys = Object.keys(a) as Array<keyof FileMetadata>;
|
|
9
|
+
const bKeys = Object.keys(b) as Array<keyof FileMetadata>;
|
|
10
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
11
|
+
for (const k of aKeys) {
|
|
12
|
+
// treat metadata/variants shallowly by reference
|
|
13
|
+
if ((a as any)[k] !== (b as any)[k]) return false;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Basic upload progress type for aggregate tracking
|
|
19
|
+
export interface FileUploadAggregateProgress {
|
|
20
|
+
current: number;
|
|
21
|
+
total: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface FileState {
|
|
25
|
+
files: Record<string, FileMetadata>;
|
|
26
|
+
order: string[]; // maintain insertion / sort order
|
|
27
|
+
uploading: boolean;
|
|
28
|
+
deleting: string | null;
|
|
29
|
+
uploadProgress: FileUploadAggregateProgress | null;
|
|
30
|
+
// actions
|
|
31
|
+
setFiles: (files: FileMetadata[], opts?: { merge?: boolean }) => void;
|
|
32
|
+
addFile: (file: FileMetadata, opts?: { prepend?: boolean }) => void;
|
|
33
|
+
updateFile: (id: string, patch: Partial<FileMetadata>) => void;
|
|
34
|
+
removeFile: (id: string) => void;
|
|
35
|
+
setUploading: (val: boolean) => void;
|
|
36
|
+
setDeleting: (id: string | null) => void;
|
|
37
|
+
setUploadProgress: (p: FileUploadAggregateProgress | null) => void;
|
|
38
|
+
reset: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const initialState = {
|
|
42
|
+
files: {} as Record<string, FileMetadata>,
|
|
43
|
+
order: [] as string[],
|
|
44
|
+
uploading: false,
|
|
45
|
+
deleting: null as string | null,
|
|
46
|
+
uploadProgress: null as FileUploadAggregateProgress | null,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const useFileStore = create<FileState>((set, get) => ({
|
|
50
|
+
...initialState,
|
|
51
|
+
setFiles: (files, opts) => set(state => {
|
|
52
|
+
const merge = opts?.merge !== false; // default true
|
|
53
|
+
if (!merge) {
|
|
54
|
+
const map: Record<string, FileMetadata> = {};
|
|
55
|
+
const order: string[] = [];
|
|
56
|
+
files.forEach(f => { map[f.id] = f; order.push(f.id); });
|
|
57
|
+
// detect if identical to avoid redundant updates
|
|
58
|
+
const sameOrder = order.length === state.order.length && order.every((id, i) => id === state.order[i]);
|
|
59
|
+
let sameFiles = sameOrder;
|
|
60
|
+
if (sameOrder) {
|
|
61
|
+
sameFiles = order.every(id => state.files[id] && shallowEqualFile(state.files[id], map[id] as FileMetadata));
|
|
62
|
+
}
|
|
63
|
+
if (sameOrder && sameFiles) return {} as any;
|
|
64
|
+
return { files: map, order };
|
|
65
|
+
}
|
|
66
|
+
const newFiles = { ...state.files };
|
|
67
|
+
const newOrder = [...state.order];
|
|
68
|
+
let changed = false;
|
|
69
|
+
files.forEach(f => {
|
|
70
|
+
const prev = state.files[f.id];
|
|
71
|
+
const merged = { ...(prev || {}), ...f } as FileMetadata;
|
|
72
|
+
if (!prev || !shallowEqualFile(prev, merged)) { newFiles[f.id] = merged; changed = true; }
|
|
73
|
+
if (!newOrder.includes(f.id)) { newOrder.unshift(f.id); changed = true; }
|
|
74
|
+
});
|
|
75
|
+
if (!changed) return {} as any;
|
|
76
|
+
return { files: newFiles, order: newOrder };
|
|
77
|
+
}),
|
|
78
|
+
addFile: (file, opts) => set(state => {
|
|
79
|
+
const prepend = opts?.prepend !== false; // default true
|
|
80
|
+
if (state.files[file.id]) {
|
|
81
|
+
if (shallowEqualFile(state.files[file.id], file)) return {} as any;
|
|
82
|
+
return { files: { ...state.files, [file.id]: file } };
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
files: { ...state.files, [file.id]: file },
|
|
86
|
+
order: prepend ? [file.id, ...state.order] : [...state.order, file.id],
|
|
87
|
+
};
|
|
88
|
+
}),
|
|
89
|
+
updateFile: (id, patch) => set(state => {
|
|
90
|
+
const existing = state.files[id];
|
|
91
|
+
if (!existing) return {} as any;
|
|
92
|
+
const updated = { ...existing, ...patch } as FileMetadata;
|
|
93
|
+
if (shallowEqualFile(existing, updated)) return {} as any;
|
|
94
|
+
return { files: { ...state.files, [id]: updated } };
|
|
95
|
+
}),
|
|
96
|
+
removeFile: (id) => set(state => {
|
|
97
|
+
if (!state.files[id]) return {} as any;
|
|
98
|
+
const { [id]: _removed, ...rest } = state.files;
|
|
99
|
+
const newOrder = state.order.filter(fid => fid !== id);
|
|
100
|
+
return { files: rest, order: newOrder };
|
|
101
|
+
}),
|
|
102
|
+
setUploading: (val) => set({ uploading: val }),
|
|
103
|
+
setDeleting: (id) => set({ deleting: id }),
|
|
104
|
+
setUploadProgress: (p) => set({ uploadProgress: p }),
|
|
105
|
+
reset: () => set(initialState),
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
// selectors
|
|
109
|
+
export const useFiles = () => {
|
|
110
|
+
const files = useFileStore(s => s.files);
|
|
111
|
+
const order = useFileStore(s => s.order);
|
|
112
|
+
// Return stable array when contents unchanged
|
|
113
|
+
const out = order.map((id: string) => files[id]);
|
|
114
|
+
return out;
|
|
115
|
+
};
|
|
116
|
+
export const useUploading = () => useFileStore(s => s.uploading);
|
|
117
|
+
export const useUploadAggregateProgress = () => useFileStore(s => s.uploadProgress);
|
|
118
|
+
export const useDeleting = () => useFileStore(s => s.deleting);
|