@umituz/react-native-subscription 2.37.39 → 2.37.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/package.json +1 -1
  2. package/src/domains/credits/application/CreditLimitCalculator.ts +1 -9
  3. package/src/domains/credits/application/DeductCreditsCommand.ts +16 -7
  4. package/src/domains/credits/application/RefundCreditsCommand.ts +1 -5
  5. package/src/domains/credits/application/credit-strategies/TrialCreditStrategy.ts +1 -5
  6. package/src/domains/credits/application/creditDocumentHelpers.ts +2 -9
  7. package/src/domains/credits/core/Credits.ts +0 -23
  8. package/src/domains/credits/core/CreditsMapper.ts +0 -6
  9. package/src/domains/credits/core/UserCreditsDocument.ts +0 -12
  10. package/src/domains/credits/infrastructure/CreditsRepositoryManager.ts +0 -21
  11. package/src/domains/credits/infrastructure/operations/CreditsWriter.ts +2 -1
  12. package/src/domains/credits/presentation/deduct-credit/useDeductCredit.ts +2 -2
  13. package/src/domains/credits/presentation/useCredits.ts +10 -9
  14. package/src/domains/paywall/components/PaywallContainer.types.ts +0 -28
  15. package/src/domains/paywall/components/PaywallModal.styles.ts +0 -4
  16. package/src/domains/paywall/entities/types.ts +0 -5
  17. package/src/domains/paywall/hooks/usePaywallActions.ts +1 -15
  18. package/src/domains/revenuecat/core/errors/RevenueCatError.ts +0 -6
  19. package/src/domains/revenuecat/core/errors/RevenueCatErrorHandler.ts +0 -24
  20. package/src/domains/revenuecat/core/errors/RevenueCatErrorMessages.ts +0 -18
  21. package/src/domains/revenuecat/core/errors/index.ts +0 -4
  22. package/src/domains/revenuecat/core/types/RevenueCatConfig.ts +3 -7
  23. package/src/domains/revenuecat/core/types/RevenueCatData.ts +4 -9
  24. package/src/domains/revenuecat/core/types/RevenueCatTypes.ts +5 -65
  25. package/src/domains/revenuecat/core/types/index.ts +0 -4
  26. package/src/domains/revenuecat/infrastructure/services/UserSwitchMutex.ts +1 -24
  27. package/src/domains/subscription/application/SubscriptionAuthListener.ts +5 -21
  28. package/src/domains/subscription/application/SubscriptionInitializerTypes.ts +1 -5
  29. package/src/domains/subscription/application/SubscriptionSyncProcessor.ts +6 -2
  30. package/src/domains/subscription/application/SubscriptionSyncService.ts +11 -2
  31. package/src/domains/subscription/application/SubscriptionSyncUtils.ts +1 -1
  32. package/src/domains/subscription/application/initializer/BackgroundInitializer.ts +15 -2
  33. package/src/domains/subscription/application/initializer/ServiceConfigurator.ts +9 -2
  34. package/src/domains/subscription/constants/thresholds.ts +0 -9
  35. package/src/domains/subscription/core/SubscriptionConstants.ts +0 -4
  36. package/src/domains/subscription/core/SubscriptionStatus.ts +11 -21
  37. package/src/domains/subscription/core/SubscriptionStatusHandlers.ts +4 -7
  38. package/src/domains/subscription/infrastructure/handlers/PurchaseStatusResolver.ts +1 -1
  39. package/src/domains/subscription/infrastructure/hooks/subscriptionQueryKeys.ts +0 -13
  40. package/src/domains/subscription/infrastructure/hooks/usePurchasePackage.ts +0 -18
  41. package/src/domains/subscription/infrastructure/hooks/useRestorePurchase.ts +3 -17
  42. package/src/domains/subscription/infrastructure/hooks/useRevenueCatTrialEligibility.ts +0 -17
  43. package/src/domains/subscription/infrastructure/hooks/useSubscriptionPackages.ts +0 -19
  44. package/src/domains/subscription/infrastructure/hooks/useSubscriptionQueries.ts +0 -6
  45. package/src/domains/subscription/infrastructure/managers/subscriptionManagerUtils.ts +0 -17
  46. package/src/domains/subscription/infrastructure/state/initializationState.ts +0 -25
  47. package/src/domains/subscription/infrastructure/utils/InitializationCache.ts +0 -21
  48. package/src/domains/subscription/infrastructure/utils/PremiumStatusSyncer.ts +2 -7
  49. package/src/domains/subscription/infrastructure/utils/authPurchaseState.ts +19 -6
  50. package/src/domains/subscription/infrastructure/utils/renewal/PackageTierComparator.ts +1 -0
  51. package/src/domains/subscription/infrastructure/utils/trialEligibilityUtils.ts +0 -18
  52. package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.styles.ts +0 -5
  53. package/src/domains/subscription/presentation/components/details/PremiumDetailsCardTypes.ts +0 -5
  54. package/src/domains/subscription/presentation/components/feedback/paywallFeedbackStyles.ts +0 -5
  55. package/src/domains/subscription/presentation/stores/index.ts +0 -4
  56. package/src/domains/subscription/presentation/stores/purchaseLoadingStore.ts +0 -13
  57. package/src/domains/subscription/presentation/useAuthAwarePurchase.ts +35 -21
  58. package/src/domains/subscription/presentation/usePaywallVisibility.ts +0 -9
  59. package/src/domains/subscription/presentation/useSubscriptionStatus.ts +8 -11
  60. package/src/domains/subscription/utils/authGuards.ts +3 -0
  61. package/src/domains/trial/application/TrialService.ts +0 -9
  62. package/src/domains/trial/core/TrialTypes.ts +0 -8
  63. package/src/domains/wallet/domain/mappers/TransactionMapper.ts +0 -5
  64. package/src/domains/wallet/domain/types/transaction.types.ts +0 -7
  65. package/src/domains/wallet/index.ts +0 -7
  66. package/src/domains/wallet/infrastructure/config/walletConfig.ts +0 -11
  67. package/src/domains/wallet/presentation/hooks/useTransactionHistory.ts +6 -3
  68. package/src/domains/wallet/presentation/hooks/useWallet.ts +0 -7
  69. package/src/domains/wallet/utils/transactionIconMap.ts +0 -10
  70. package/src/global.d.ts +0 -6
  71. package/src/index.ts +1 -4
  72. package/src/init/createSubscriptionInitModule.ts +12 -2
  73. package/src/init/index.ts +1 -5
  74. package/src/presentation/hooks/feedback/useFeedbackSubmit.ts +0 -11
  75. package/src/shared/application/FeedbackService.ts +3 -21
  76. package/src/shared/application/ports/ISubscriptionRepository.ts +0 -4
  77. package/src/shared/infrastructure/SubscriptionEventBus.ts +0 -13
  78. package/src/shared/infrastructure/firestore/collectionUtils.ts +1 -17
  79. package/src/shared/infrastructure/firestore/index.ts +0 -4
  80. package/src/shared/infrastructure/firestore/resultUtils.ts +0 -12
  81. package/src/shared/infrastructure/react-query/hooks/usePreviousUserCleanup.ts +0 -17
  82. package/src/shared/infrastructure/react-query/queryConfig.ts +0 -15
  83. package/src/shared/utils/BaseError.ts +0 -5
  84. package/src/shared/utils/Result.ts +0 -20
  85. package/src/shared/utils/dateConverter.ts +6 -46
  86. package/src/utils/appUtils.ts +0 -16
  87. package/src/utils/creditMapper.ts +0 -7
  88. package/src/utils/dateUtils.compare.ts +0 -24
  89. package/src/utils/dateUtils.core.ts +0 -39
  90. package/src/utils/dateUtils.format.ts +0 -41
  91. package/src/utils/dateUtils.math.ts +0 -41
  92. package/src/utils/dateUtils.ts +0 -5
  93. package/src/utils/packagePeriodUtils.ts +0 -20
  94. package/src/utils/packageTypeDetector.ts +1 -21
  95. package/src/utils/premiumStatusUtils.ts +1 -14
  96. package/src/utils/priceUtils.ts +0 -35
  97. package/src/utils/tierUtils.ts +1 -8
  98. package/src/utils/types.ts +1 -25
  99. package/src/utils/validation.ts +1 -7
  100. package/src/domains/README.md +0 -52
  101. package/src/domains/config/domain/README.md +0 -37
  102. package/src/domains/config/domain/entities/README.md +0 -41
  103. package/src/domains/paywall/README.md +0 -101
  104. package/src/domains/paywall/entities/README.md +0 -40
  105. package/src/domains/paywall/hooks/README.md +0 -41
  106. package/src/domains/subscription/application/syncConstants.ts +0 -1
  107. package/src/domains/subscription/infrastructure/README.md +0 -41
  108. package/src/domains/subscription/infrastructure/config/README.md +0 -49
  109. package/src/domains/subscription/infrastructure/handlers/README.md +0 -41
  110. package/src/domains/subscription/infrastructure/hooks/README.md +0 -50
  111. package/src/domains/subscription/infrastructure/managers/README.md +0 -41
  112. package/src/domains/subscription/infrastructure/services/README.md +0 -42
  113. package/src/domains/subscription/infrastructure/utils/README.md +0 -41
  114. package/src/domains/subscription/presentation/components/README.md +0 -155
  115. package/src/domains/subscription/presentation/components/details/CreditRow.md +0 -92
  116. package/src/domains/subscription/presentation/components/details/DetailRow.md +0 -91
  117. package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.md +0 -93
  118. package/src/domains/subscription/presentation/components/details/PremiumStatusBadge.md +0 -91
  119. package/src/domains/subscription/presentation/components/details/README.md +0 -99
  120. package/src/domains/subscription/presentation/components/feedback/PaywallFeedbackModal.md +0 -90
  121. package/src/domains/subscription/presentation/components/feedback/README.md +0 -99
  122. package/src/domains/subscription/presentation/components/paywall/PaywallModal.md +0 -94
  123. package/src/domains/subscription/presentation/components/paywall/README.md +0 -54
  124. package/src/domains/subscription/presentation/components/sections/README.md +0 -99
  125. package/src/domains/subscription/presentation/components/sections/SubscriptionSection.md +0 -94
  126. package/src/domains/subscription/presentation/utils/README.md +0 -31
  127. package/src/domains/wallet/README.md +0 -51
  128. package/src/domains/wallet/domain/README.md +0 -41
  129. package/src/domains/wallet/infrastructure/README.md +0 -41
  130. package/src/domains/wallet/presentation/components/README.md +0 -41
  131. package/src/domains/wallet/presentation/hooks/README.md +0 -41
  132. package/src/shared/application/ports/README.md +0 -48
@@ -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)
@@ -1,94 +0,0 @@
1
- # PaywallModal Component
2
-
3
- Modal paywall component for subscription upgrade.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/paywall/PaywallModal.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Paywall Display Flow
16
-
17
- 1. **Modal Visibility**: Control visibility via isVisible prop
18
- 2. **Configuration**: Display features, pricing, and benefits
19
- 3. **Package Display**: Show available subscription packages
20
- 4. **Purchase Handling**: Handle purchase initiation and completion
21
- 5. **Close Behavior**: Handle modal close/dismissal
22
- 6. **Responsive Design**: Adapt to different screen sizes
23
-
24
- ### Integration Points
25
-
26
- - **usePaywallVisibility**: For modal visibility control
27
- - **useSubscriptionPackages**: For available packages
28
- - **usePaywallOperations**: For purchase handling
29
- - **Analytics**: For tracking impressions and conversions
30
- - **Navigation**: For post-purchase navigation
31
-
32
- ## Restrictions
33
-
34
- ### REQUIRED
35
-
36
- - **Visibility Control**: MUST control via isVisible prop
37
- - **Close Handler**: MUST provide onClose callback
38
- - **Purchase Handler**: MUST implement onPurchase callback
39
- - **Package Display**: MUST show available packages
40
-
41
- ### PROHIBITED
42
-
43
- - **NEVER** trap users without close option
44
- - **NEVER** show without user trigger or clear reason
45
- - **DO NOT** show too frequently
46
- - **DO NOT** hide pricing information
47
-
48
- ### CRITICAL SAFETY
49
-
50
- - **ALWAYS** provide clear close button
51
- - **NEVER** trap users in modal
52
- - **MUST** handle all purchase outcomes
53
- - **ALWAYS** show pricing clearly
54
-
55
- ## AI Agent Guidelines
56
-
57
- ### When Implementing Paywall Modals
58
-
59
- 1. **Always** provide clear close button
60
- 2. **Always** show pricing transparently
61
- 3. **Always** handle all purchase outcomes
62
- 4. **Always** track impressions and conversions
63
- 5. **Never** trap users without exit
64
-
65
- ### Integration Checklist
66
-
67
- - [ ] Import from correct path: `@umituz/react-native-subscription`
68
- - [ ] Control visibility via isVisible prop
69
- - [ ] Implement onClose callback
70
- - [ ] Implement onPurchase callback
71
- - [ ] Configure features and benefits
72
- - [ ] Display package options
73
- - [ ] Handle loading states
74
- - [ ] Track analytics events
75
- - [ ] Test purchase flow
76
- - [ ] Test close behavior
77
- - [ ] Verify responsive design
78
-
79
- ### Common Patterns
80
-
81
- 1. **Manual Trigger**: Show on button press
82
- 2. **Usage Limit**: Show after N free uses
83
- 3. **Feature Gate**: Show when accessing premium feature
84
- 4. **Time-based**: Show after certain time/usage
85
- 5. **Event-driven**: Show on specific app events
86
- 6. **A/B Testing**: Test different copy and layouts
87
-
88
- ## Related Documentation
89
-
90
- - **usePaywall**: Paywall state management
91
- - **usePaywallOperations**: Purchase operations
92
- - **usePaywallVisibility**: Visibility control
93
- - **PaywallDomain**: `../../../domains/paywall/README.md`
94
- - **Paywall README**: `./README.md`
@@ -1,54 +0,0 @@
1
- # Paywall Components
2
-
3
- UI components specifically designed for paywall and subscription upgrade screens.
4
-
5
- ## Location
6
-
7
- `src/presentation/components/paywall/`
8
-
9
- ## Strategy
10
-
11
- Specialized components for displaying paywalls, package selection, and subscription upgrade prompts. These components handle the visual presentation of subscription offers and user purchase flows.
12
-
13
- ## Restrictions
14
-
15
- ### REQUIRED
16
-
17
- - Must use design tokens for consistent styling
18
- - Must support multiple display modes (card, list, minimal)
19
- - Must include loading states
20
- - Must handle accessibility requirements
21
- - Must support screen readers
22
- - Must provide proper touch targets
23
-
24
- ### PROHIBITED
25
-
26
- - MUST NOT hardcode pricing or product information
27
- - MUST NOT bypass payment validation
28
- - MUST NOT expose RevenueCat implementation details
29
- - MUST NOT create custom payment flows outside approved patterns
30
-
31
- ### CRITICAL
32
-
33
- - All purchase flows MUST go through RevenueCat
34
- - Never log or transmit sensitive payment information
35
- - Always handle errors gracefully with user-friendly messages
36
- - Must support cancellation and refund flows
37
-
38
- ## AI Agent Guidelines
39
-
40
- When modifying paywall components:
41
- 1. Maintain visual hierarchy for recommended packages
42
- 2. Ensure clear pricing display (price, period, per-month equivalent)
43
- 3. Keep features easy to understand
44
- 4. Include social proof elements (ratings, reviews, user counts)
45
- 5. Add trust signals (guarantees, badges, certifications)
46
- 6. Optimize for mobile screens
47
- 7. Lazy load images and avoid expensive animations
48
- 8. Always support accessibility standards
49
-
50
- ## Related Documentation
51
-
52
- - [Paywall Domain](../../../domains/paywall/README.md)
53
- - [Paywall Hooks](../../hooks/README.md)
54
- - [RevenueCat Integration](../../../revenuecat/README.md)
@@ -1,99 +0,0 @@
1
- # Sections Components
2
-
3
- Subscription-related section and card components.
4
-
5
- ## Location
6
-
7
- - **Base Path**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/sections/`
8
- - **Components**: `src/presentation/components/sections/`
9
-
10
- ## Strategy
11
-
12
- ### Section Components
13
-
14
- Organized sections for subscription information display.
15
-
16
- - **SubscriptionSection**: Subscription status and management section
17
- - **Status Display**: Clear status indicators
18
- - **Action Buttons**: Management and upgrade actions
19
- - **Navigation Support**: Deep linking to detail screens
20
-
21
- ### Display Features
22
-
23
- Comprehensive subscription information display.
24
-
25
- - **Status Indicators**: Active/inactive status display
26
- - **Expiration Dates**: Date formatting and display
27
- - **Management Actions**: Subscription management buttons
28
- - **Upgrade Options**: Premium upgrade prompts
29
-
30
- ### Interaction Design
31
-
32
- User-friendly interaction patterns.
33
-
34
- - **Press Actions**: Navigation to detail screens
35
- - **Long Press**: Quick management options
36
- - **Status-Based UI**: Different UI for different subscription states
37
- - **Refresh Support**: Pull-to-refresh capabilities
38
-
39
- ### Customization
40
-
41
- Flexible styling and behavior.
42
-
43
- - **Custom Actions**: Custom action handlers
44
- - **Style Props**: Custom styling support
45
- - **Translation Support**: Multi-language support
46
- - **Conditional Display**: Show/hide elements based on state
47
-
48
- ## Restrictions
49
-
50
- ### REQUIRED
51
-
52
- - **Status Clarity**: Status must be clearly visible
53
- - **Action Buttons**: Provide appropriate action buttons
54
- - **Loading States**: Show loading indicators
55
- - **Error Handling**: Handle errors gracefully
56
-
57
- ### PROHIBITED
58
-
59
- - **Hardcoded Text**: All text must support translations
60
- - **Missing Actions**: Never omit necessary actions
61
- - **Ambiguous Status**: Status must be unambiguous
62
- - **Blocking UI**: Never block app navigation
63
-
64
- ### CRITICAL
65
-
66
- - **Deep Links**: Include management deep links
67
- - **State Accuracy**: Display accurate subscription state
68
- - **User Actions**: Provide clear action options
69
- - **Platform Links**: Correct platform-specific management links
70
-
71
- ## AI Agent Guidelines
72
-
73
- ### When Modifying Section Components
74
-
75
- 1. **Component Interface**: Maintain consistent prop interfaces
76
- 2. **State Handling**: Proper state management
77
- 3. **Translations**: Ensure translation support
78
- 4. **Accessibility**: Include accessibility features
79
-
80
- ### When Adding Section Features
81
-
82
- 1. **Pattern Consistency**: Follow existing patterns
83
- 2. **Type Safety**: Define TypeScript types
84
- 3. **Documentation**: Document props and usage
85
- 4. **Testing**: Test with different subscription states
86
-
87
- ### When Fixing Section Component Bugs
88
-
89
- 1. **State Display**: Check state display logic
90
- 2. **Actions**: Verify action handlers
91
- 3. **Navigation**: Test navigation flows
92
- 4. **Edge Cases**: Test with null/undefined states
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
- - [Feedback Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/feedback/README.md)
98
- - [Presentation Components](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/presentation/components/README.md)
99
- - [Paywall Domain](/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-subscription/src/domains/paywall/README.md)
@@ -1,94 +0,0 @@
1
- # SubscriptionSection Component
2
-
3
- Section component displaying subscription status with details and actions.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/sections/SubscriptionSection.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Subscription Information Display
16
-
17
- 1. **Status Detection**: Display current subscription status (active/inactive/free)
18
- 2. **Detail Rendering**: Show expiration date, renewal status, product info
19
- 3. **Action Buttons**: Display manage or upgrade button based on status
20
- 4. **Loading States**: Handle loading and error states gracefully
21
- 5. **Translation Support**: Support custom translations for all text
22
- 6. **Visual Hierarchy**: Clear structure with status badge, details, and actions
23
-
24
- ### Integration Points
25
-
26
- - **useSubscriptionStatus**: For subscription status data
27
- - **usePremium**: For premium status check
28
- - **DetailRow**: For displaying individual detail items
29
- - **PremiumStatusBadge**: For status badge display
30
- - **Navigation**: For manage/upgrade button actions
31
-
32
- ## Restrictions
33
-
34
- ### REQUIRED
35
-
36
- - **Config Prop**: MUST provide valid subscription config object
37
- - **Callback Handling**: MUST implement button callbacks
38
- - **Loading State**: MUST handle loading state in UI
39
- - **Null Handling**: MUST handle null status values
40
-
41
- ### PROHIBITED
42
-
43
- - **NEVER** display without config data (show loading instead)
44
- - **NEVER** hardcode status text (use translations)
45
- - **DO NOT** show both manage and upgrade buttons simultaneously
46
- - **DO NOT** show buttons for loading state
47
-
48
- ### CRITICAL SAFETY
49
-
50
- - **ALWAYS** handle loading state before displaying data
51
- - **MUST** validate config object before rendering
52
- - **ALWAYS** provide clear button labels
53
- - **NEVER** expose sensitive implementation details
54
-
55
- ## AI Agent Guidelines
56
-
57
- ### When Implementing Subscription Sections
58
-
59
- 1. **Always** provide valid subscription config
60
- 2. **Always** handle loading state
61
- 3. **Always** implement both 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 config
69
- - [ ] Implement onUpgradePress callback
70
- - [ ] Implement onManagePress callback
71
- - [ ] Handle loading state
72
- - [ ] Handle null dates
73
- - [ ] Provide translations for localization
74
- - [ ] Test with active subscription
75
- - [ ] Test with expired subscription
76
- - [ ] Test with free user
77
- - [ ] Test with lifetime subscription
78
-
79
- ### Common Patterns
80
-
81
- 1. **Settings Integration**: Add to settings screen
82
- 2. **Profile Display**: Show in user profile
83
- 3. **Status Card**: Display as standalone card
84
- 4. **With Navigation**: Navigate to detailed management
85
- 5. **Localized Display**: Use with i18n libraries
86
- 6. **Conditional Rendering**: Show/hide based on auth state
87
-
88
- ## Related Documentation
89
-
90
- - **PremiumDetailsCard**: Detailed premium card
91
- - **DetailRow**: Individual detail item
92
- - **PremiumStatusBadge**: Status badge component
93
- - **Subscription Hooks**: `../../hooks/README.md`
94
- - **Sections README**: `./README.md`
@@ -1,31 +0,0 @@
1
- # Presentation Utils
2
-
3
- Utility functions and helpers for the presentation layer.
4
-
5
- ## Overview
6
-
7
- This directory contains utility functions used by presentation components and hooks.
8
-
9
- ## Contents
10
-
11
- - **subscriptionDateUtils.ts** - Date formatting and manipulation for subscription display
12
- - **paywallUtils.ts** - Paywall-related utility functions
13
-
14
- ## Date Utilities
15
-
16
- ### formatDate
17
-
18
- Format ISO date string to localized date string.
19
-
20
- ### calculateDaysRemaining
21
-
22
- Calculate days between now and expiration date.
23
-
24
- ### convertPurchasedAt
25
-
26
- Convert purchasedAt date to ISO string.
27
-
28
- ## Related
29
-
30
- - [Hooks](../hooks/README.md)
31
- - [Types](../types/README.md)