@umituz/react-native-ai-generation-content 1.83.50 → 1.83.52
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.52",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"url": "git+https://github.com/umituz/react-native-ai-generation-content.git"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@umituz/react-native-auth": "
|
|
42
|
+
"@umituz/react-native-auth": "^4.3.34"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@react-navigation/native": ">=6.0.0",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"react-native-safe-area-context": ">=5.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@umituz/react-native-ai-fal-provider": "^3.2.0",
|
|
61
60
|
"@expo/vector-icons": "^15.0.3",
|
|
62
61
|
"@gorhom/bottom-sheet": "^5.2.8",
|
|
63
62
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
@@ -71,6 +70,7 @@
|
|
|
71
70
|
"@types/react": "~19.1.10",
|
|
72
71
|
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
73
72
|
"@typescript-eslint/parser": "^8.54.0",
|
|
73
|
+
"@umituz/react-native-ai-fal-provider": "^3.2.0",
|
|
74
74
|
"@umituz/react-native-design-system": "latest",
|
|
75
75
|
"@umituz/react-native-firebase": "latest",
|
|
76
76
|
"@umituz/react-native-subscription": "^2.35.3",
|
|
@@ -52,18 +52,16 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
52
52
|
const { creditCost, onNetworkError, onSuccess, onError } = options;
|
|
53
53
|
|
|
54
54
|
const { isOffline } = useOffline();
|
|
55
|
-
const {
|
|
55
|
+
const { hasFirebaseUser } = useAuth();
|
|
56
56
|
const { showAuthModal } = useAuthModalStore();
|
|
57
57
|
const { isPremium } = usePremium();
|
|
58
58
|
const { credits, isCreditsLoaded, isLoading: isCreditsLoading } = useCredits();
|
|
59
59
|
const { openPaywall } = usePaywallVisibility();
|
|
60
|
-
|
|
61
|
-
const isAuthenticated = rawIsAuth && !isAnonymous;
|
|
62
60
|
const creditBalance = credits?.credits ?? 0;
|
|
63
61
|
const hasCredits = creditBalance >= creditCost;
|
|
64
62
|
|
|
65
63
|
const { requireFeature: requireFeatureFromPackage } = useFeatureGate({
|
|
66
|
-
isAuthenticated,
|
|
64
|
+
isAuthenticated: hasFirebaseUser,
|
|
67
65
|
onShowAuthModal: (cb?: () => void) => showAuthModal(cb),
|
|
68
66
|
hasSubscription: isPremium,
|
|
69
67
|
creditBalance,
|
|
@@ -73,8 +71,8 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
73
71
|
});
|
|
74
72
|
|
|
75
73
|
const canAccess = useMemo(
|
|
76
|
-
() => !isOffline &&
|
|
77
|
-
[isOffline,
|
|
74
|
+
() => !isOffline && hasFirebaseUser && (isPremium || hasCredits),
|
|
75
|
+
[isOffline, hasFirebaseUser, isPremium, hasCredits],
|
|
78
76
|
);
|
|
79
77
|
|
|
80
78
|
const requireFeature = useCallback(
|
|
@@ -82,7 +80,7 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
82
80
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
83
81
|
console.log("[AIFeatureGate] requireFeature called:", {
|
|
84
82
|
isOffline,
|
|
85
|
-
|
|
83
|
+
hasFirebaseUser,
|
|
86
84
|
isCreditsLoaded,
|
|
87
85
|
isPremium,
|
|
88
86
|
creditBalance,
|
|
@@ -99,9 +97,9 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
99
97
|
return false;
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
if (
|
|
100
|
+
if (hasFirebaseUser && !isCreditsLoaded) {
|
|
103
101
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
104
|
-
console.log("[AIFeatureGate] BLOCKED: User
|
|
102
|
+
console.log("[AIFeatureGate] BLOCKED: User has Firebase account but credits not loaded yet");
|
|
105
103
|
}
|
|
106
104
|
return false;
|
|
107
105
|
}
|
|
@@ -119,7 +117,7 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
119
117
|
|
|
120
118
|
return executed;
|
|
121
119
|
},
|
|
122
|
-
[isOffline,
|
|
120
|
+
[isOffline, hasFirebaseUser, isCreditsLoaded, isPremium, creditBalance, creditCost, hasCredits, onNetworkError, requireFeatureFromPackage, onSuccess, onError],
|
|
123
121
|
);
|
|
124
122
|
|
|
125
123
|
return {
|
|
@@ -127,7 +125,7 @@ export function useAIFeatureGate(options: AIFeatureGateOptions): AIFeatureGateRe
|
|
|
127
125
|
canAccess,
|
|
128
126
|
isCheckingAccess: isCreditsLoading,
|
|
129
127
|
hasCredits,
|
|
130
|
-
isAuthenticated,
|
|
128
|
+
isAuthenticated: hasFirebaseUser,
|
|
131
129
|
isPremium,
|
|
132
130
|
creditBalance,
|
|
133
131
|
isOffline,
|