@umituz/react-native-subscription 2.37.38 → 2.37.40
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 +1 -1
- package/src/domains/credits/application/CreditLimitCalculator.ts +1 -9
- package/src/domains/credits/application/CreditsInitializer.ts +5 -20
- package/src/domains/credits/application/DeductCreditsCommand.ts +13 -6
- package/src/domains/credits/application/RefundCreditsCommand.ts +1 -5
- package/src/domains/credits/application/credit-strategies/CreditAllocationOrchestrator.ts +1 -9
- package/src/domains/credits/application/credit-strategies/ICreditStrategy.ts +1 -5
- package/src/domains/credits/application/credit-strategies/TrialCreditStrategy.ts +1 -5
- package/src/domains/credits/application/creditDocumentHelpers.ts +2 -9
- package/src/domains/credits/application/creditOperationUtils.ts +1 -43
- package/src/domains/credits/core/Credits.ts +0 -23
- package/src/domains/credits/core/CreditsConstants.ts +0 -11
- package/src/domains/credits/core/CreditsMapper.ts +0 -6
- package/src/domains/credits/core/UserCreditsDocument.ts +0 -12
- package/src/domains/credits/infrastructure/CreditsRepository.ts +6 -1
- package/src/domains/credits/infrastructure/CreditsRepositoryManager.ts +0 -21
- package/src/domains/credits/infrastructure/operations/CreditsWriter.ts +52 -1
- package/src/domains/credits/presentation/deduct-credit/useDeductCredit.ts +2 -2
- package/src/domains/credits/presentation/useCredits.ts +10 -9
- package/src/domains/paywall/components/PaywallContainer.types.ts +0 -28
- package/src/domains/paywall/components/PaywallModal.styles.ts +0 -4
- package/src/domains/paywall/entities/types.ts +0 -5
- package/src/domains/paywall/hooks/usePaywallActions.ts +1 -15
- package/src/domains/revenuecat/core/errors/RevenueCatError.ts +0 -6
- package/src/domains/revenuecat/core/errors/RevenueCatErrorHandler.ts +0 -24
- package/src/domains/revenuecat/core/errors/RevenueCatErrorMessages.ts +0 -18
- package/src/domains/revenuecat/core/errors/index.ts +0 -4
- package/src/domains/revenuecat/core/types/RevenueCatConfig.ts +3 -7
- package/src/domains/revenuecat/core/types/RevenueCatData.ts +4 -9
- package/src/domains/revenuecat/core/types/RevenueCatTypes.ts +5 -65
- package/src/domains/revenuecat/core/types/index.ts +0 -4
- package/src/domains/revenuecat/infrastructure/services/UserSwitchMutex.ts +1 -24
- package/src/domains/subscription/application/SubscriptionAuthListener.ts +5 -21
- package/src/domains/subscription/application/SubscriptionInitializerTypes.ts +1 -5
- package/src/domains/subscription/application/SubscriptionSyncProcessor.ts +0 -4
- package/src/domains/subscription/application/SubscriptionSyncService.ts +4 -8
- package/src/domains/subscription/application/SubscriptionSyncUtils.ts +1 -1
- package/src/domains/subscription/application/initializer/BackgroundInitializer.ts +15 -2
- package/src/domains/subscription/application/initializer/ServiceConfigurator.ts +9 -2
- package/src/domains/subscription/application/statusChangeHandlers.ts +14 -27
- package/src/domains/subscription/application/syncIdGenerators.ts +0 -4
- package/src/domains/subscription/constants/thresholds.ts +0 -9
- package/src/domains/subscription/core/SubscriptionConstants.ts +0 -4
- package/src/domains/subscription/core/SubscriptionStatus.ts +11 -21
- package/src/domains/subscription/core/SubscriptionStatusHandlers.ts +4 -7
- package/src/domains/subscription/infrastructure/handlers/PurchaseStatusResolver.ts +1 -1
- package/src/domains/subscription/infrastructure/hooks/subscriptionQueryKeys.ts +0 -13
- package/src/domains/subscription/infrastructure/hooks/usePurchasePackage.ts +0 -18
- package/src/domains/subscription/infrastructure/hooks/useRestorePurchase.ts +3 -17
- package/src/domains/subscription/infrastructure/hooks/useRevenueCatTrialEligibility.ts +0 -17
- package/src/domains/subscription/infrastructure/hooks/useSubscriptionPackages.ts +0 -19
- package/src/domains/subscription/infrastructure/hooks/useSubscriptionQueries.ts +0 -6
- package/src/domains/subscription/infrastructure/managers/subscriptionManagerUtils.ts +0 -17
- package/src/domains/subscription/infrastructure/state/initializationState.ts +0 -25
- package/src/domains/subscription/infrastructure/utils/InitializationCache.ts +0 -21
- package/src/domains/subscription/infrastructure/utils/PremiumStatusSyncer.ts +3 -17
- package/src/domains/subscription/infrastructure/utils/authPurchaseState.ts +0 -5
- package/src/domains/subscription/infrastructure/utils/renewal/PackageTierComparator.ts +1 -0
- package/src/domains/subscription/infrastructure/utils/trialEligibilityUtils.ts +0 -18
- package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.styles.ts +0 -5
- package/src/domains/subscription/presentation/components/details/PremiumDetailsCardTypes.ts +0 -5
- package/src/domains/subscription/presentation/components/feedback/paywallFeedbackStyles.ts +0 -5
- package/src/domains/subscription/presentation/stores/index.ts +0 -4
- package/src/domains/subscription/presentation/stores/purchaseLoadingStore.ts +0 -13
- package/src/domains/subscription/presentation/useAuthAwarePurchase.ts +30 -21
- package/src/domains/subscription/presentation/usePaywallVisibility.ts +0 -9
- package/src/domains/subscription/presentation/useSubscriptionStatus.ts +8 -11
- package/src/domains/subscription/utils/authGuards.ts +3 -0
- package/src/domains/trial/application/TrialService.ts +0 -9
- package/src/domains/trial/core/TrialTypes.ts +0 -8
- package/src/domains/wallet/domain/mappers/TransactionMapper.ts +0 -5
- package/src/domains/wallet/domain/types/transaction.types.ts +0 -7
- package/src/domains/wallet/index.ts +0 -7
- package/src/domains/wallet/infrastructure/config/walletConfig.ts +0 -11
- package/src/domains/wallet/presentation/hooks/useTransactionHistory.ts +6 -3
- package/src/domains/wallet/presentation/hooks/useWallet.ts +0 -7
- package/src/domains/wallet/utils/transactionIconMap.ts +0 -10
- package/src/global.d.ts +0 -6
- package/src/index.ts +1 -4
- package/src/init/createSubscriptionInitModule.ts +12 -2
- package/src/init/index.ts +1 -5
- package/src/presentation/hooks/feedback/useFeedbackSubmit.ts +0 -11
- package/src/shared/application/FeedbackService.ts +3 -21
- package/src/shared/application/ports/ISubscriptionRepository.ts +0 -4
- package/src/shared/infrastructure/SubscriptionEventBus.ts +0 -13
- package/src/shared/infrastructure/firestore/collectionUtils.ts +1 -17
- package/src/shared/infrastructure/firestore/index.ts +0 -4
- package/src/shared/infrastructure/firestore/resultUtils.ts +0 -12
- package/src/shared/infrastructure/react-query/hooks/usePreviousUserCleanup.ts +0 -17
- package/src/shared/infrastructure/react-query/queryConfig.ts +0 -15
- package/src/shared/utils/BaseError.ts +0 -5
- package/src/shared/utils/Result.ts +0 -20
- package/src/shared/utils/dateConverter.ts +6 -46
- package/src/utils/appUtils.ts +0 -16
- package/src/utils/creditMapper.ts +0 -7
- package/src/utils/dateUtils.compare.ts +0 -24
- package/src/utils/dateUtils.core.ts +0 -39
- package/src/utils/dateUtils.format.ts +0 -41
- package/src/utils/dateUtils.math.ts +0 -41
- package/src/utils/dateUtils.ts +0 -5
- package/src/utils/packagePeriodUtils.ts +0 -20
- package/src/utils/packageTypeDetector.ts +1 -21
- package/src/utils/premiumStatusUtils.ts +1 -14
- package/src/utils/priceUtils.ts +0 -35
- package/src/utils/tierUtils.ts +1 -8
- package/src/utils/types.ts +1 -25
- package/src/utils/validation.ts +1 -7
- package/src/domains/README.md +0 -52
- package/src/domains/config/domain/README.md +0 -37
- package/src/domains/config/domain/entities/README.md +0 -41
- package/src/domains/credits/application/credit-strategies/SyncCreditStrategy.ts +0 -24
- package/src/domains/paywall/README.md +0 -101
- package/src/domains/paywall/entities/README.md +0 -40
- package/src/domains/paywall/hooks/README.md +0 -41
- package/src/domains/subscription/application/syncConstants.ts +0 -1
- package/src/domains/subscription/infrastructure/README.md +0 -41
- package/src/domains/subscription/infrastructure/config/README.md +0 -49
- package/src/domains/subscription/infrastructure/handlers/README.md +0 -41
- package/src/domains/subscription/infrastructure/hooks/README.md +0 -50
- package/src/domains/subscription/infrastructure/managers/README.md +0 -41
- package/src/domains/subscription/infrastructure/services/README.md +0 -42
- package/src/domains/subscription/infrastructure/utils/README.md +0 -41
- package/src/domains/subscription/presentation/components/README.md +0 -155
- package/src/domains/subscription/presentation/components/details/CreditRow.md +0 -92
- package/src/domains/subscription/presentation/components/details/DetailRow.md +0 -91
- package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.md +0 -93
- package/src/domains/subscription/presentation/components/details/PremiumStatusBadge.md +0 -91
- package/src/domains/subscription/presentation/components/details/README.md +0 -99
- package/src/domains/subscription/presentation/components/feedback/PaywallFeedbackModal.md +0 -90
- package/src/domains/subscription/presentation/components/feedback/README.md +0 -99
- package/src/domains/subscription/presentation/components/paywall/PaywallModal.md +0 -94
- package/src/domains/subscription/presentation/components/paywall/README.md +0 -54
- package/src/domains/subscription/presentation/components/sections/README.md +0 -99
- package/src/domains/subscription/presentation/components/sections/SubscriptionSection.md +0 -94
- package/src/domains/subscription/presentation/utils/README.md +0 -31
- package/src/domains/wallet/README.md +0 -51
- package/src/domains/wallet/domain/README.md +0 -41
- package/src/domains/wallet/infrastructure/README.md +0 -41
- package/src/domains/wallet/presentation/components/README.md +0 -41
- package/src/domains/wallet/presentation/hooks/README.md +0 -41
- package/src/shared/application/ports/README.md +0 -48
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# CreditRow Component
|
|
2
|
-
|
|
3
|
-
Row component displaying credit information with amount and label.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
**Import Path**: `@umituz/react-native-subscription`
|
|
8
|
-
|
|
9
|
-
**File**: `src/presentation/components/details/CreditRow.tsx`
|
|
10
|
-
|
|
11
|
-
**Type**: Component
|
|
12
|
-
|
|
13
|
-
## Strategy
|
|
14
|
-
|
|
15
|
-
### Credit Information Display
|
|
16
|
-
|
|
17
|
-
1. **Amount Display**: Show credit amount with icon
|
|
18
|
-
2. **Label Display**: Show credit type or source label
|
|
19
|
-
3. **Visual Hierarchy**: Clear separation between amount and label
|
|
20
|
-
4. **Icon Integration**: Display appropriate icon for credit type
|
|
21
|
-
5. **Styling Options**: Support custom styling override
|
|
22
|
-
6. **Compact Layout**: Efficient use of space for list items
|
|
23
|
-
|
|
24
|
-
### Integration Points
|
|
25
|
-
|
|
26
|
-
- **useCredits**: For credit balance and transaction data
|
|
27
|
-
- **Icon System**: For credit type icons
|
|
28
|
-
- **List Components**: For credit transaction lists
|
|
29
|
-
- **Settings UI**: For credits section in settings
|
|
30
|
-
|
|
31
|
-
## Restrictions
|
|
32
|
-
|
|
33
|
-
### REQUIRED
|
|
34
|
-
|
|
35
|
-
- **Amount Prop**: MUST provide valid credit amount
|
|
36
|
-
- **Label Prop**: MUST provide descriptive label
|
|
37
|
-
- **Icon Display**: SHOULD display appropriate icon
|
|
38
|
-
- **Null Handling**: MUST handle null or zero values
|
|
39
|
-
|
|
40
|
-
### PROHIBITED
|
|
41
|
-
|
|
42
|
-
- **NEVER** display without amount
|
|
43
|
-
- **NEVER** hardcode icon types
|
|
44
|
-
- **DO NOT** use for non-credit data
|
|
45
|
-
- **DO NOT** display negative amounts without clear indication
|
|
46
|
-
|
|
47
|
-
### CRITICAL SAFETY
|
|
48
|
-
|
|
49
|
-
- **ALWAYS** validate amount prop
|
|
50
|
-
- **MUST** handle zero or null amounts
|
|
51
|
-
- **ALWAYS** provide clear labels
|
|
52
|
-
- **NEVER** expose raw transaction data
|
|
53
|
-
|
|
54
|
-
## AI Agent Guidelines
|
|
55
|
-
|
|
56
|
-
### When Implementing Credit Rows
|
|
57
|
-
|
|
58
|
-
1. **Always** provide valid amount
|
|
59
|
-
2. **Always** provide clear label
|
|
60
|
-
3. **Always** display appropriate icon
|
|
61
|
-
4. **Always** handle zero amounts
|
|
62
|
-
5. **Never** use for non-credit display
|
|
63
|
-
|
|
64
|
-
### Integration Checklist
|
|
65
|
-
|
|
66
|
-
- [ ] Import from correct path: `@umituz/react-native-subscription`
|
|
67
|
-
- [ ] Provide valid amount prop
|
|
68
|
-
- [ ] Provide clear label prop
|
|
69
|
-
- [ ] Display appropriate icon
|
|
70
|
-
- [ ] Handle zero amounts
|
|
71
|
-
- [ ] Handle null amounts
|
|
72
|
-
- [ ] Apply custom styling if needed
|
|
73
|
-
- [ ] Test with positive amount
|
|
74
|
-
- [ ] Test with zero amount
|
|
75
|
-
- [ ] Test in list context
|
|
76
|
-
- [ ] Test standalone display
|
|
77
|
-
|
|
78
|
-
### Common Patterns
|
|
79
|
-
|
|
80
|
-
1. **Transaction List**: Show credit transactions
|
|
81
|
-
2. **Balance Display**: Show current balance
|
|
82
|
-
3. **Allocation Breakdown**: Show credit sources
|
|
83
|
-
4. **History View**: Display transaction history
|
|
84
|
-
5. **Settings Section**: Credits section in settings
|
|
85
|
-
|
|
86
|
-
## Related Documentation
|
|
87
|
-
|
|
88
|
-
- **DetailRow**: Generic detail row component
|
|
89
|
-
- **PremiumDetailsCard**: Premium details card
|
|
90
|
-
- **useCredits**: Credits hook
|
|
91
|
-
- **Credits README**: `../../../../domains/wallet/README.md`
|
|
92
|
-
- **Details README**: `./README.md`
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# DetailRow Component
|
|
2
|
-
|
|
3
|
-
Simple row component displaying a label-value pair for subscription details.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
**Import Path**: `@umituz/react-native-subscription`
|
|
8
|
-
|
|
9
|
-
**File**: `src/presentation/components/details/DetailRow.tsx`
|
|
10
|
-
|
|
11
|
-
**Type**: Component
|
|
12
|
-
|
|
13
|
-
## Strategy
|
|
14
|
-
|
|
15
|
-
### Label-Value Display
|
|
16
|
-
|
|
17
|
-
1. **Label Positioning**: Display label on left side
|
|
18
|
-
2. **Value Positioning**: Display value on right side
|
|
19
|
-
3. **Space Distribution**: Even spacing between label and value
|
|
20
|
-
4. **Highlight Option**: Support highlighting values (e.g., expiration warnings)
|
|
21
|
-
5. **Custom Styling**: Allow style overrides for flexibility
|
|
22
|
-
6. **Consistent Layout**: Maintain consistent vertical spacing
|
|
23
|
-
|
|
24
|
-
### Integration Points
|
|
25
|
-
|
|
26
|
-
- **PremiumDetailsCard**: Uses this component internally
|
|
27
|
-
- **SubscriptionSection**: For subscription detail display
|
|
28
|
-
- **Settings Screens**: For settings detail items
|
|
29
|
-
- **List Components**: For detail lists
|
|
30
|
-
|
|
31
|
-
## Restrictions
|
|
32
|
-
|
|
33
|
-
### REQUIRED
|
|
34
|
-
|
|
35
|
-
- **Label Prop**: MUST provide valid label string
|
|
36
|
-
- **Value Prop**: MUST provide valid value string
|
|
37
|
-
- **Spacing**: MUST maintain consistent spacing
|
|
38
|
-
- **Null Handling**: MUST handle null or undefined values
|
|
39
|
-
|
|
40
|
-
### PROHIBITED
|
|
41
|
-
|
|
42
|
-
- **NEVER** display without label and value
|
|
43
|
-
- **NEVER** use highlight for non-warning cases
|
|
44
|
-
- **DO NOT** use excessively long labels (affects layout)
|
|
45
|
-
- **DO NOT** mix different data types in same list
|
|
46
|
-
|
|
47
|
-
### CRITICAL SAFETY
|
|
48
|
-
|
|
49
|
-
- **ALWAYS** validate label and value props
|
|
50
|
-
- **MUST** handle empty strings
|
|
51
|
-
- **ALWAYS** use highlight sparingly (for warnings only)
|
|
52
|
-
- **NEVER** expose sensitive raw data
|
|
53
|
-
|
|
54
|
-
## AI Agent Guidelines
|
|
55
|
-
|
|
56
|
-
### When Implementing Detail Rows
|
|
57
|
-
|
|
58
|
-
1. **Always** provide clear, concise labels
|
|
59
|
-
2. **Always** format values appropriately
|
|
60
|
-
3. **Always** use highlight only for warnings
|
|
61
|
-
4. **Always** keep labels short and consistent
|
|
62
|
-
5. **Never** display implementation details
|
|
63
|
-
|
|
64
|
-
### Integration Checklist
|
|
65
|
-
|
|
66
|
-
- [ ] Import from correct path: `@umituz/react-native-subscription`
|
|
67
|
-
- [ ] Provide valid label prop
|
|
68
|
-
- [ ] Provide valid value prop
|
|
69
|
-
- [ ] Format values appropriately
|
|
70
|
-
- [ ] Use highlight for warnings only
|
|
71
|
-
- [ ] Apply custom styling if needed
|
|
72
|
-
- [ ] Test with short values
|
|
73
|
-
- [ ] Test with long values
|
|
74
|
-
- [ ] Test with highlight enabled
|
|
75
|
-
- [ ] Test in list context
|
|
76
|
-
- [ ] Test standalone display
|
|
77
|
-
|
|
78
|
-
### Common Patterns
|
|
79
|
-
|
|
80
|
-
1. **Subscription Details**: Show subscription info
|
|
81
|
-
2. **Settings Items**: Display settings values
|
|
82
|
-
3. **Status Information**: Show various status types
|
|
83
|
-
4. **Date Display**: Format and show dates
|
|
84
|
-
5. **Compact Lists**: Display multiple details
|
|
85
|
-
|
|
86
|
-
## Related Documentation
|
|
87
|
-
|
|
88
|
-
- **PremiumDetailsCard**: Uses this component
|
|
89
|
-
- **CreditRow**: Similar component for credits
|
|
90
|
-
- **SubscriptionSection**: Section containing detail rows
|
|
91
|
-
- **Details README**: `./README.md`
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# PremiumDetailsCard Component
|
|
2
|
-
|
|
3
|
-
Premium subscription details card component.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
**Import Path**: `@umituz/react-native-subscription`
|
|
8
|
-
|
|
9
|
-
**File**: `src/presentation/components/details/PremiumDetailsCard.tsx`
|
|
10
|
-
|
|
11
|
-
**Type**: Component
|
|
12
|
-
|
|
13
|
-
## Strategy
|
|
14
|
-
|
|
15
|
-
### Premium Status Card Display
|
|
16
|
-
|
|
17
|
-
1. **Status Display**: Show premium status with badge
|
|
18
|
-
2. **Detail Rendering**: Display subscription details (expiration, renewal, etc.)
|
|
19
|
-
3. **Action Buttons**: Show manage or upgrade button based on status
|
|
20
|
-
4. **Translation Support**: Support custom translations
|
|
21
|
-
5. **Visual Hierarchy**: Clear structure with header, details, and actions
|
|
22
|
-
6. **Responsive Design**: Adapt to different screen sizes
|
|
23
|
-
|
|
24
|
-
### Integration Points
|
|
25
|
-
|
|
26
|
-
- **useSubscriptionStatus**: For subscription status data
|
|
27
|
-
- **DetailRow**: For displaying individual details
|
|
28
|
-
- **PremiumStatusBadge**: For status badge
|
|
29
|
-
- **usePremium**: For premium status check
|
|
30
|
-
- **Navigation**: For button actions
|
|
31
|
-
|
|
32
|
-
## Restrictions
|
|
33
|
-
|
|
34
|
-
### REQUIRED
|
|
35
|
-
|
|
36
|
-
- **Status Prop**: MUST provide valid subscription status object
|
|
37
|
-
- **Callback Handling**: MUST implement button callbacks
|
|
38
|
-
- **Loading State**: MUST handle loading state
|
|
39
|
-
- **Null Handling**: MUST handle null status values
|
|
40
|
-
|
|
41
|
-
### PROHIBITED
|
|
42
|
-
|
|
43
|
-
- **NEVER** display without status data
|
|
44
|
-
- **NEVER** hardcode status text (use translations)
|
|
45
|
-
- **DO NOT** show both manage and upgrade buttons
|
|
46
|
-
- **DO NOT** expose sensitive implementation details
|
|
47
|
-
|
|
48
|
-
### CRITICAL SAFETY
|
|
49
|
-
|
|
50
|
-
- **ALWAYS** validate status object
|
|
51
|
-
- **MUST** handle loading state
|
|
52
|
-
- **ALWAYS** provide clear button labels
|
|
53
|
-
- **NEVER** trust client-side status for security
|
|
54
|
-
|
|
55
|
-
## AI Agent Guidelines
|
|
56
|
-
|
|
57
|
-
### When Implementing Premium Cards
|
|
58
|
-
|
|
59
|
-
1. **Always** provide valid subscription status
|
|
60
|
-
2. **Always** handle loading state
|
|
61
|
-
3. **Always** implement button callbacks
|
|
62
|
-
4. **Always** use translations for localization
|
|
63
|
-
5. **Never** hardcode status strings
|
|
64
|
-
|
|
65
|
-
### Integration Checklist
|
|
66
|
-
|
|
67
|
-
- [ ] Import from correct path: `@umituz/react-native-subscription`
|
|
68
|
-
- [ ] Provide valid subscription status
|
|
69
|
-
- [ ] Implement onManagePress callback
|
|
70
|
-
- [ ] Implement onUpgradePress callback
|
|
71
|
-
- [ ] Handle loading state
|
|
72
|
-
- [ ] Handle null dates
|
|
73
|
-
- [ ] Provide translations
|
|
74
|
-
- [ ] Test with active premium
|
|
75
|
-
- [ ] Test with expired subscription
|
|
76
|
-
- [ ] Test with free user
|
|
77
|
-
- [ ] Test with lifetime subscription
|
|
78
|
-
|
|
79
|
-
### Common Patterns
|
|
80
|
-
|
|
81
|
-
1. **Profile Display**: Show in user profile
|
|
82
|
-
2. **Settings Card**: Display in settings screen
|
|
83
|
-
3. **Status Overview**: Show premium status overview
|
|
84
|
-
4. **With Navigation**: Navigate to management
|
|
85
|
-
5. **Localized Display**: Use with i18n
|
|
86
|
-
|
|
87
|
-
## Related Documentation
|
|
88
|
-
|
|
89
|
-
- **PremiumStatusBadge**: Status badge component
|
|
90
|
-
- **DetailRow**: Detail item component
|
|
91
|
-
- **SubscriptionSection**: Subscription section
|
|
92
|
-
- **usePremium**: Premium status hook
|
|
93
|
-
- **Details README**: `./README.md`
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# PremiumStatusBadge Component
|
|
2
|
-
|
|
3
|
-
Compact badge component displaying premium status.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
**Import Path**: `@umituz/react-native-subscription`
|
|
8
|
-
|
|
9
|
-
**File**: `src/presentation/components/details/PremiumStatusBadge.tsx`
|
|
10
|
-
|
|
11
|
-
**Type**: Component
|
|
12
|
-
|
|
13
|
-
## Strategy
|
|
14
|
-
|
|
15
|
-
### Status Badge Display
|
|
16
|
-
|
|
17
|
-
1. **Status Detection**: Display appropriate status (premium/free)
|
|
18
|
-
2. **Visual Indication**: Use color and icon to indicate status
|
|
19
|
-
3. **Compact Design**: Small footprint for various use cases
|
|
20
|
-
4. **Styling Options**: Support different sizes and styles
|
|
21
|
-
5. **Accessibility**: Include accessibility labels
|
|
22
|
-
6. **Color Coding**: Use consistent colors for status types
|
|
23
|
-
|
|
24
|
-
### Integration Points
|
|
25
|
-
|
|
26
|
-
- **usePremium**: For premium status check
|
|
27
|
-
- **Headers**: Display in screen headers
|
|
28
|
-
- **Cards**: Add to cards as status indicator
|
|
29
|
-
- **Lists**: Use in list items as badge
|
|
30
|
-
- **Buttons**: Add to buttons for premium features
|
|
31
|
-
|
|
32
|
-
## Restrictions
|
|
33
|
-
|
|
34
|
-
### REQUIRED
|
|
35
|
-
|
|
36
|
-
- **Status Prop**: MUST provide valid status boolean
|
|
37
|
-
- **Accessibility**: MUST include accessibility label
|
|
38
|
-
- **Color Consistency**: MUST use consistent colors
|
|
39
|
-
- **Size Constraint**: SHOULD maintain compact size
|
|
40
|
-
|
|
41
|
-
### PROHIBITED
|
|
42
|
-
|
|
43
|
-
- **NEVER** display without status prop
|
|
44
|
-
- **NEVER** use inconsistent colors
|
|
45
|
-
- **DO NOT** make badge too large
|
|
46
|
-
- **DO NOT** use for non-premium status
|
|
47
|
-
|
|
48
|
-
### CRITICAL SAFETY
|
|
49
|
-
|
|
50
|
-
- **ALWAYS** validate status prop
|
|
51
|
-
- **MUST** include accessibility support
|
|
52
|
-
- **ALWAYS** use approved color schemes
|
|
53
|
-
- **NEVER** expose implementation logic
|
|
54
|
-
|
|
55
|
-
## AI Agent Guidelines
|
|
56
|
-
|
|
57
|
-
### When Implementing Status Badges
|
|
58
|
-
|
|
59
|
-
1. **Always** provide valid status boolean
|
|
60
|
-
2. **Always** include accessibility label
|
|
61
|
-
3. **Always** use consistent colors
|
|
62
|
-
4. **Always** maintain compact size
|
|
63
|
-
5. **Never** use for non-status indicators
|
|
64
|
-
|
|
65
|
-
### Integration Checklist
|
|
66
|
-
|
|
67
|
-
- [ ] Import from correct path: `@umituz/react-native-subscription`
|
|
68
|
-
- [ ] Provide valid status prop
|
|
69
|
-
- [ ] Include accessibility label
|
|
70
|
-
- [ ] Apply appropriate styling
|
|
71
|
-
- [ ] Test with premium status
|
|
72
|
-
- [ ] Test with free status
|
|
73
|
-
- [ ] Test in different contexts
|
|
74
|
-
- [ ] Verify color consistency
|
|
75
|
-
- [ ] Check accessibility support
|
|
76
|
-
- [ ] Test size constraints
|
|
77
|
-
|
|
78
|
-
### Common Patterns
|
|
79
|
-
|
|
80
|
-
1. **Header Badge**: Display in screen headers
|
|
81
|
-
2. **Card Badge**: Add to premium cards
|
|
82
|
-
3. **List Indicator**: Use in list items
|
|
83
|
-
4. **Button Badge**: Add to premium feature buttons
|
|
84
|
-
5. **Profile Badge**: Show in user profile
|
|
85
|
-
|
|
86
|
-
## Related Documentation
|
|
87
|
-
|
|
88
|
-
- **PremiumDetailsCard**: Premium status card
|
|
89
|
-
- **DetailRow**: Detail row component
|
|
90
|
-
- **usePremium**: Premium status hook
|
|
91
|
-
- **Details README**: `./README.md`
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# Details Components
|
|
2
|
-
|
|
3
|
-
UI components for displaying subscription and premium details.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
- **Base Path**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/details/`
|
|
8
|
-
- **Components**: `src/presentation/components/details/`
|
|
9
|
-
|
|
10
|
-
## Strategy
|
|
11
|
-
|
|
12
|
-
### Component Architecture
|
|
13
|
-
|
|
14
|
-
Specialized components for subscription detail display.
|
|
15
|
-
|
|
16
|
-
- **PremiumDetailsCard**: Premium subscription details card
|
|
17
|
-
- **PremiumStatusBadge**: Status badge display
|
|
18
|
-
- **DetailRow**: Individual detail row component
|
|
19
|
-
- **CreditRow**: Credit balance display component
|
|
20
|
-
|
|
21
|
-
### Display Components
|
|
22
|
-
|
|
23
|
-
Structured information display components.
|
|
24
|
-
|
|
25
|
-
- **Subscription Status**: Active/inactive status display
|
|
26
|
-
- **Expiration Dates**: Date formatting and display
|
|
27
|
-
- **Product Information**: Plan and product details
|
|
28
|
-
- **Credit Balance**: Credit amount display
|
|
29
|
-
|
|
30
|
-
### Translation Support
|
|
31
|
-
|
|
32
|
-
Multi-language support for all displayed text.
|
|
33
|
-
|
|
34
|
-
- **Translation Props**: Optional translation overrides
|
|
35
|
-
- **Default Translations**: Built-in language support
|
|
36
|
-
- **Date Formatting**: Locale-aware date formatting
|
|
37
|
-
- **Currency Formatting**: Locale-aware currency display
|
|
38
|
-
|
|
39
|
-
### Styling System
|
|
40
|
-
|
|
41
|
-
Flexible styling and customization.
|
|
42
|
-
|
|
43
|
-
- **Style Props**: Custom style support
|
|
44
|
-
- **Theme Support**: Theme-aware styling
|
|
45
|
-
- **Responsive Design**: Adaptive layouts
|
|
46
|
-
- **Accessibility**: Accessibility features
|
|
47
|
-
|
|
48
|
-
## Restrictions
|
|
49
|
-
|
|
50
|
-
### REQUIRED
|
|
51
|
-
|
|
52
|
-
- **Loading States**: Show loading indicators while fetching data
|
|
53
|
-
- **Error States**: Handle and display errors appropriately
|
|
54
|
-
- **Translation Support**: Support multiple languages
|
|
55
|
-
- **Accessibility**: Include accessibility labels
|
|
56
|
-
|
|
57
|
-
### PROHIBITED
|
|
58
|
-
|
|
59
|
-
- **Hardcoded Text**: All text must support translations
|
|
60
|
-
- **Missing Null Checks**: Handle null/undefined values
|
|
61
|
-
- **Blocking UI**: Never block app flow
|
|
62
|
-
- **Assumed Data**: Never assume data exists
|
|
63
|
-
|
|
64
|
-
### CRITICAL
|
|
65
|
-
|
|
66
|
-
- **Data Validation**: Validate all displayed data
|
|
67
|
-
- **Edge Cases**: Handle missing or invalid data
|
|
68
|
-
- **Performance**: Optimize re-renders
|
|
69
|
-
- **User Experience**: Smooth interactions and transitions
|
|
70
|
-
|
|
71
|
-
## AI Agent Guidelines
|
|
72
|
-
|
|
73
|
-
### When Modifying Detail Components
|
|
74
|
-
|
|
75
|
-
1. **Component Props**: Maintain consistent prop interfaces
|
|
76
|
-
2. **Styling**: Preserve responsive design
|
|
77
|
-
3. **Translations**: Ensure translation support
|
|
78
|
-
4. **Testing**: Test with various data states
|
|
79
|
-
|
|
80
|
-
### When Adding New Detail Components
|
|
81
|
-
|
|
82
|
-
1. **Pattern Consistency**: Follow existing component patterns
|
|
83
|
-
2. **Type Safety**: Define TypeScript types
|
|
84
|
-
3. **Documentation**: Document props and usage
|
|
85
|
-
4. **Accessibility**: Include accessibility features
|
|
86
|
-
|
|
87
|
-
### When Fixing Detail Component Bugs
|
|
88
|
-
|
|
89
|
-
1. **Data Flow**: Check data flow and state
|
|
90
|
-
2. **Edge Cases**: Test with null/undefined
|
|
91
|
-
3. **Rendering**: Verify rendering logic
|
|
92
|
-
4. **Styling**: Check style application
|
|
93
|
-
|
|
94
|
-
## Related Documentation
|
|
95
|
-
|
|
96
|
-
- [Presentation Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/README.md)
|
|
97
|
-
- [Feedback Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/feedback/README.md)
|
|
98
|
-
- [Sections Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/sections/README.md)
|
|
99
|
-
- [Paywall Domain](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/domains/paywall/README.md)
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# PaywallFeedbackModal Component
|
|
2
|
-
|
|
3
|
-
Modal component for collecting user feedback after paywall dismissal.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
**Import Path**: `@umituz/react-native-subscription`
|
|
8
|
-
|
|
9
|
-
**File**: `src/presentation/components/feedback/PaywallFeedbackModal.tsx`
|
|
10
|
-
|
|
11
|
-
**Type**: Component
|
|
12
|
-
|
|
13
|
-
## Strategy
|
|
14
|
-
|
|
15
|
-
### Feedback Collection Flow
|
|
16
|
-
|
|
17
|
-
1. **Trigger Display**: Show modal after paywall dismissal
|
|
18
|
-
2. **Feedback Options**: Provide multiple feedback options
|
|
19
|
-
3. **Reason Capture**: Allow users to select reason for not upgrading
|
|
20
|
-
4. **Comment Input**: Optional text input for detailed feedback
|
|
21
|
-
5. **Submission**: Handle feedback submission
|
|
22
|
-
6. **Analytics**: Track feedback for optimization
|
|
23
|
-
|
|
24
|
-
### Integration Points
|
|
25
|
-
|
|
26
|
-
- **PaywallModal**: Trigger after paywall close
|
|
27
|
-
- **Analytics Service**: Track feedback responses
|
|
28
|
-
- **Backend API**: Submit feedback to server
|
|
29
|
-
- **usePaywall**: For paywall state management
|
|
30
|
-
|
|
31
|
-
## Restrictions
|
|
32
|
-
|
|
33
|
-
### REQUIRED
|
|
34
|
-
|
|
35
|
-
- **Visible Control**: MUST control visibility via prop
|
|
36
|
-
- **Callback Handling**: MUST implement onFeedbackSubmit callback
|
|
37
|
-
- **Close Handler**: MUST provide close mechanism
|
|
38
|
-
- **Feedback Options**: MUST provide clear feedback options
|
|
39
|
-
|
|
40
|
-
### PROHIBITED
|
|
41
|
-
|
|
42
|
-
- **NEVER** show modal automatically (user-triggered only)
|
|
43
|
-
- **NEVER** make feedback mandatory
|
|
44
|
-
- **DO NOT** show too frequently (respect user experience)
|
|
45
|
-
- **DO NOT** require personal information
|
|
46
|
-
|
|
47
|
-
### CRITICAL SAFETY
|
|
48
|
-
|
|
49
|
-
- **ALWAYS** make feedback optional
|
|
50
|
-
- **MUST** provide clear close option
|
|
51
|
-
- **ALWAYS** keep feedback anonymous by default
|
|
52
|
-
- **NEVER** collect sensitive information
|
|
53
|
-
|
|
54
|
-
## AI Agent Guidelines
|
|
55
|
-
|
|
56
|
-
### When Implementing Feedback Modals
|
|
57
|
-
|
|
58
|
-
1. **Always** make feedback optional
|
|
59
|
-
2. **Always** provide clear close button
|
|
60
|
-
3. **Always** keep feedback options concise
|
|
61
|
-
4. **Always** handle feedback submission gracefully
|
|
62
|
-
5. **Never** show modal too frequently
|
|
63
|
-
|
|
64
|
-
### Integration Checklist
|
|
65
|
-
|
|
66
|
-
- [ ] Import from correct path: `@umituz/react-native-subscription`
|
|
67
|
-
- [ ] Control visibility via isVisible prop
|
|
68
|
-
- [ ] Implement onFeedbackSubmit callback
|
|
69
|
-
- [ ] Provide onClose callback
|
|
70
|
-
- [ ] Keep feedback options concise (3-5 options)
|
|
71
|
-
- [ ] Make feedback optional
|
|
72
|
-
- [ ] Handle submission errors
|
|
73
|
-
- [ ] Test with various feedback selections
|
|
74
|
-
- [ ] Test close behavior
|
|
75
|
-
- [ ] Verify analytics tracking
|
|
76
|
-
|
|
77
|
-
### Common Patterns
|
|
78
|
-
|
|
79
|
-
1. **Post-Paywall**: Show after paywall dismissal
|
|
80
|
-
2. **Anonymous Feedback**: Keep feedback anonymous
|
|
81
|
-
3. **Simple Options**: Provide 3-5 quick options
|
|
82
|
-
4. **Optional Comment**: Allow optional detailed feedback
|
|
83
|
-
5. **Analytics Integration**: Track feedback for insights
|
|
84
|
-
|
|
85
|
-
## Related Documentation
|
|
86
|
-
|
|
87
|
-
- **PaywallModal**: Paywall modal component
|
|
88
|
-
- **usePaywall**: Paywall state management
|
|
89
|
-
- **Feedback README**: `./README.md`
|
|
90
|
-
- **Paywall README**: `../paywall/README.md`
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# Feedback Components
|
|
2
|
-
|
|
3
|
-
UI components for user interaction and feedback collection.
|
|
4
|
-
|
|
5
|
-
## Location
|
|
6
|
-
|
|
7
|
-
- **Base Path**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/feedback/`
|
|
8
|
-
- **Components**: `src/presentation/components/feedback/`
|
|
9
|
-
|
|
10
|
-
## Strategy
|
|
11
|
-
|
|
12
|
-
### Feedback Collection
|
|
13
|
-
|
|
14
|
-
User feedback system for paywall and subscription flows.
|
|
15
|
-
|
|
16
|
-
- **PaywallFeedbackModal**: Paywall experience feedback modal
|
|
17
|
-
- **Rating System**: Optional rating functionality
|
|
18
|
-
- **Text Feedback**: Open text feedback input
|
|
19
|
-
- **Categorization**: Feedback categorization options
|
|
20
|
-
|
|
21
|
-
### Analytics Integration
|
|
22
|
-
|
|
23
|
-
Feedback tracking and analytics.
|
|
24
|
-
|
|
25
|
-
- **Event Tracking**: Feedback submission tracking
|
|
26
|
-
- **User Insights**: Feedback analysis capabilities
|
|
27
|
-
- **Timing Context**: Paywall interaction timing
|
|
28
|
-
- **Reason Categories**: Structured feedback categories
|
|
29
|
-
|
|
30
|
-
### Modal Architecture
|
|
31
|
-
|
|
32
|
-
Modal-based feedback collection.
|
|
33
|
-
|
|
34
|
-
- **Smooth Animations**: Native-feeling transitions
|
|
35
|
-
- **Optional Display**: Non-intrusive feedback requests
|
|
36
|
-
- **Custom Content**: Customizable feedback forms
|
|
37
|
-
- **Context Aware**: Context-aware feedback triggers
|
|
38
|
-
|
|
39
|
-
### Translation Support
|
|
40
|
-
|
|
41
|
-
Multi-language feedback interface.
|
|
42
|
-
|
|
43
|
-
- **Translation Props**: Custom translation support
|
|
44
|
-
- **Placeholder Text**: Localized placeholders
|
|
45
|
-
- **Button Labels**: Localized action buttons
|
|
46
|
-
- **Rating Labels**: Localized rating descriptions
|
|
47
|
-
|
|
48
|
-
## Restrictions
|
|
49
|
-
|
|
50
|
-
### REQUIRED
|
|
51
|
-
|
|
52
|
-
- **Optional Feedback**: Never force feedback submission
|
|
53
|
-
- **Privacy Notice**: Inform users about feedback usage
|
|
54
|
-
- **Analytics Tracking**: Track all feedback submissions
|
|
55
|
-
- **Translation Support**: Support multiple languages
|
|
56
|
-
|
|
57
|
-
### PROHIBITED
|
|
58
|
-
|
|
59
|
-
- **Mandatory Feedback**: Feedback must always be optional
|
|
60
|
-
- **Excessive Length**: Keep feedback requests short
|
|
61
|
-
- **Complex UI**: Maintain simple, intuitive interface
|
|
62
|
-
- **Missing Privacy**: Always explain feedback usage
|
|
63
|
-
|
|
64
|
-
### CRITICAL
|
|
65
|
-
|
|
66
|
-
- **User Experience**: Non-intrusive feedback requests
|
|
67
|
-
- **Timing**: Show feedback at appropriate times
|
|
68
|
-
- **Actionable Insights**: Collect actionable feedback
|
|
69
|
-
- **Privacy**: Protect user privacy
|
|
70
|
-
|
|
71
|
-
## AI Agent Guidelines
|
|
72
|
-
|
|
73
|
-
### When Modifying Feedback Components
|
|
74
|
-
|
|
75
|
-
1. **User Experience**: Maintain non-intrusive design
|
|
76
|
-
2. **Analytics**: Ensure proper tracking
|
|
77
|
-
3. **Translations**: Support multiple languages
|
|
78
|
-
4. **Privacy**: Maintain privacy standards
|
|
79
|
-
|
|
80
|
-
### When Adding Feedback Features
|
|
81
|
-
|
|
82
|
-
1. **Modal Pattern**: Follow existing modal patterns
|
|
83
|
-
2. **Analytics Integration**: Add tracking for new features
|
|
84
|
-
3. **Type Safety**: Define proper TypeScript types
|
|
85
|
-
4. **Documentation**: Document usage and props
|
|
86
|
-
|
|
87
|
-
### When Fixing Feedback Component Bugs
|
|
88
|
-
|
|
89
|
-
1. **Modal Logic**: Check modal open/close logic
|
|
90
|
-
2. **Form Handling**: Verify form submission
|
|
91
|
-
3. **Analytics**: Verify analytics tracking
|
|
92
|
-
4. **User Flow**: Test complete feedback flow
|
|
93
|
-
|
|
94
|
-
## Related Documentation
|
|
95
|
-
|
|
96
|
-
- [Details Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/details/README.md)
|
|
97
|
-
- [Paywall Domain](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/domains/paywall/README.md)
|
|
98
|
-
- [Presentation Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/README.md)
|
|
99
|
-
- [RevenueCat Integration](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/revenuecat/README.md)
|