@umituz/react-native-subscription 2.14.99 → 2.14.101

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 (98) hide show
  1. package/README.md +211 -394
  2. package/package.json +3 -3
  3. package/src/application/README.md +46 -225
  4. package/src/application/ports/README.md +42 -97
  5. package/src/domain/README.md +36 -384
  6. package/src/domain/constants/README.md +0 -56
  7. package/src/domain/entities/README.md +43 -169
  8. package/src/domain/entities/SubscriptionStatus.ts +1 -1
  9. package/src/domain/errors/README.md +33 -287
  10. package/src/domain/value-objects/README.md +43 -179
  11. package/src/domains/README.md +50 -238
  12. package/src/domains/README.md.bak +274 -0
  13. package/src/domains/config/README.md +93 -383
  14. package/src/domains/config/domain/README.md +23 -376
  15. package/src/domains/config/domain/entities/README.md +34 -343
  16. package/src/domains/paywall/README.md +99 -369
  17. package/src/domains/paywall/components/README.md +34 -178
  18. package/src/domains/paywall/entities/README.md +34 -193
  19. package/src/domains/paywall/hooks/README.md +34 -122
  20. package/src/domains/wallet/README.md +34 -275
  21. package/src/domains/wallet/README.md.bak +209 -0
  22. package/src/domains/wallet/domain/README.md +34 -101
  23. package/src/domains/wallet/domain/entities/README.md +34 -115
  24. package/src/domains/wallet/domain/errors/README.md +34 -151
  25. package/src/domains/wallet/infrastructure/README.md +34 -89
  26. package/src/domains/wallet/presentation/components/README.md +34 -224
  27. package/src/domains/wallet/presentation/components/TransactionItem.tsx +1 -1
  28. package/src/domains/wallet/presentation/hooks/README.md +34 -248
  29. package/src/infrastructure/README.md +37 -496
  30. package/src/infrastructure/mappers/README.md +0 -13
  31. package/src/infrastructure/repositories/README.md +74 -360
  32. package/src/infrastructure/services/ActivationHandler.ts +1 -1
  33. package/src/infrastructure/services/README.md +95 -370
  34. package/src/infrastructure/services/SubscriptionService.ts +1 -1
  35. package/src/presentation/README.md +123 -408
  36. package/src/presentation/README.md.bak +172 -0
  37. package/src/presentation/components/README.md +151 -179
  38. package/src/presentation/components/README.md.bak +217 -0
  39. package/src/presentation/components/details/CreditRow.md +65 -310
  40. package/src/presentation/components/details/DetailRow.md +63 -255
  41. package/src/presentation/components/details/PremiumDetailsCard.md +65 -238
  42. package/src/presentation/components/details/PremiumStatusBadge.md +64 -239
  43. package/src/presentation/components/details/README.md +97 -447
  44. package/src/presentation/components/feedback/PaywallFeedbackModal.md +63 -287
  45. package/src/presentation/components/feedback/README.md +97 -445
  46. package/src/presentation/components/paywall/PaywallModal.md +66 -416
  47. package/src/presentation/components/paywall/README.md +50 -186
  48. package/src/presentation/components/sections/README.md +97 -466
  49. package/src/presentation/components/sections/SubscriptionSection.md +92 -244
  50. package/src/presentation/hooks/README.md +154 -741
  51. package/src/presentation/hooks/useAuthAwarePurchase.md +58 -325
  52. package/src/presentation/hooks/useAuthGate.md +61 -375
  53. package/src/presentation/hooks/useAuthSubscriptionSync.md +66 -370
  54. package/src/presentation/hooks/useCreditChecker.md +73 -378
  55. package/src/presentation/hooks/useCredits.md +74 -313
  56. package/src/presentation/hooks/useCredits.md.bak +231 -0
  57. package/src/presentation/hooks/useCreditsGate.md +66 -318
  58. package/src/presentation/hooks/useDeductCredit.md +0 -76
  59. package/src/presentation/hooks/useDeductCredit.ts +1 -1
  60. package/src/presentation/hooks/useDevTestCallbacks.md +63 -394
  61. package/src/presentation/hooks/useFeatureGate.md +105 -150
  62. package/src/presentation/hooks/useFeatureGate.md.bak +284 -0
  63. package/src/presentation/hooks/useInitializeCredits.md +64 -430
  64. package/src/presentation/hooks/usePaywall.md +61 -306
  65. package/src/presentation/hooks/usePaywallOperations.md +64 -458
  66. package/src/presentation/hooks/usePaywallVisibility.md +67 -316
  67. package/src/presentation/hooks/usePremium.md +84 -226
  68. package/src/presentation/hooks/usePremiumGate.md +60 -395
  69. package/src/presentation/hooks/usePremiumWithCredits.md +64 -401
  70. package/src/presentation/hooks/useSubscription.md +66 -422
  71. package/src/presentation/hooks/useSubscriptionDetails.md +65 -410
  72. package/src/presentation/hooks/useSubscriptionGate.md +80 -164
  73. package/src/presentation/hooks/useSubscriptionSettingsConfig.md +66 -346
  74. package/src/presentation/hooks/useSubscriptionStatus.md +66 -396
  75. package/src/presentation/hooks/useUserTier.md +63 -328
  76. package/src/presentation/hooks/useUserTierWithRepository.md +64 -424
  77. package/src/presentation/screens/README.md +48 -190
  78. package/src/presentation/types/README.md +0 -16
  79. package/src/presentation/utils/README.md +0 -21
  80. package/src/presentation/utils/subscriptionDateUtils.ts +1 -1
  81. package/src/revenuecat/README.md +99 -518
  82. package/src/revenuecat/application/README.md +35 -150
  83. package/src/revenuecat/application/ports/README.md +34 -162
  84. package/src/revenuecat/domain/README.md +42 -141
  85. package/src/revenuecat/domain/constants/README.md +34 -176
  86. package/src/revenuecat/domain/entities/README.md +34 -374
  87. package/src/revenuecat/domain/errors/README.md +47 -191
  88. package/src/revenuecat/domain/types/README.md +34 -366
  89. package/src/revenuecat/domain/value-objects/README.md +34 -434
  90. package/src/revenuecat/infrastructure/README.md +34 -43
  91. package/src/revenuecat/infrastructure/config/README.md +32 -23
  92. package/src/revenuecat/infrastructure/handlers/README.md +34 -211
  93. package/src/revenuecat/infrastructure/managers/README.md +34 -42
  94. package/src/revenuecat/infrastructure/services/README.md +35 -318
  95. package/src/revenuecat/infrastructure/utils/README.md +34 -375
  96. package/src/revenuecat/presentation/README.md +34 -176
  97. package/src/revenuecat/presentation/hooks/README.md +29 -35
  98. package/src/utils/README.md +38 -525
@@ -1,449 +1,99 @@
1
1
  # Details Components
2
2
 
3
- Abonelik ve premium detaylarını göstermek için UI bileşenleri.
4
-
5
- ## Bileşenler
6
-
7
- - [PremiumDetailsCard](#premiumdetailscard) - Premium detay kartı
8
- - [PremiumStatusBadge](#premiumstatusbadge) - Durum badge'i
9
- - [DetailRow](#detailrow) - Detay satırı
10
- - [CreditRow](#creditrow) - Kredi satırı
11
-
12
- ## PremiumDetailsCard
13
-
14
- Premium abonelik detaylarını gösteren kart bileşeni.
15
-
16
- ### Kullanım
17
-
18
- ```typescript
19
- import { PremiumDetailsCard } from '@umituz/react-native-subscription';
20
-
21
- <PremiumDetailsCard
22
- status={{
23
- type: 'premium',
24
- isActive: true,
25
- isPremium: true,
26
- expirationDate: '2025-12-31T23:59:59Z',
27
- willRenew: true,
28
- productId: 'com.app.premium.annual',
29
- }}
30
- onUpgradePress={() => console.log('Upgrade pressed')}
31
- onManagePress={() => console.log('Manage pressed')}
32
- translations={{
33
- title: 'Premium',
34
- status: 'Active',
35
- expires: 'Expires on',
36
- renews: 'Renews on',
37
- manage: 'Manage Subscription',
38
- upgrade: 'Upgrade to Premium',
39
- }}
40
- />
41
- ```
42
-
43
- ### Props
44
-
45
- ```typescript
46
- interface PremiumDetailsCardProps {
47
- status: SubscriptionStatus;
48
- onUpgradePress?: () => void;
49
- onManagePress?: () => void;
50
- style?: ViewStyle;
51
- translations?: PremiumDetailsCardTranslations;
52
- }
53
- ```
54
-
55
- ### Özellikler
56
-
57
- - Abonelik durumunu gösterir (Active, Expired, vb.)
58
- - Son kullanma tarihini görüntüler
59
- - Yenileme durumunu gösterir
60
- - Upgrade ve Manage butonları
61
- - Özelleştirilebilir çeviri desteği
62
-
63
- ## PremiumStatusBadge
64
-
65
- Kullanıcının premium durumunu gösteren badge bileşeni.
66
-
67
- ### Kullanım
68
-
69
- ```typescript
70
- import { PremiumStatusBadge } from '@umituz/react-native-subscription';
71
-
72
- <PremiumStatusBadge
73
- status="premium"
74
- size="medium"
75
- showIcon={true}
76
- />
77
-
78
- <PremiumStatusBadge
79
- status="free"
80
- size="small"
81
- showIcon={false}
82
- />
83
- ```
84
-
85
- ### Props
86
-
87
- ```typescript
88
- interface PremiumStatusBadgeProps {
89
- status: SubscriptionStatusType;
90
- size?: 'small' | 'medium' | 'large';
91
- showIcon?: boolean;
92
- style?: ViewStyle;
93
- }
94
- ```
95
-
96
- ### Özellikler
97
-
98
- - Farklı boyut seçenekleri
99
- - İkon gösterimi/hiding
100
- - Durum bazlı renkler
101
- - Responsive tasarım
102
-
103
- ## DetailRow
104
-
105
- Detay gösterimi için satır bileşeni.
106
-
107
- ### Kullanım
108
-
109
- ```typescript
110
- import { DetailRow } from '@umituz/react-native-subscription';
111
-
112
- <DetailRow
113
- label="Subscription Type"
114
- value="Annual Premium"
115
- />
116
-
117
- <DetailRow
118
- label="Price"
119
- value="$79.99/year"
120
- />
121
-
122
- <DetailRow
123
- label="Status"
124
- value="Active"
125
- valueColor="green"
126
- />
127
- ```
128
-
129
- ### Props
130
-
131
- ```typescript
132
- interface DetailRowProps {
133
- label: string;
134
- value: string;
135
- valueColor?: string;
136
- style?: ViewStyle;
137
- }
138
- ```
139
-
140
- ## CreditRow
141
-
142
- Kredi bakiyesi gösterimi için satır bileşeni.
143
-
144
- ### Kullanım
145
-
146
- ```typescript
147
- import { CreditRow } from '@umituz/react-native-subscription';
148
-
149
- <CreditRow
150
- credits={150}
151
- currency="USD"
152
- showBalance={true}
153
- />
154
-
155
- <CreditRow
156
- credits={50}
157
- currency="USD"
158
- showBalance={false}
159
- translations={{
160
- credits: 'Credits',
161
- balance: 'Balance',
162
- }}
163
- />
164
- ```
165
-
166
- ### Props
167
-
168
- ```typescript
169
- interface CreditRowProps {
170
- credits: number;
171
- currency?: string;
172
- showBalance?: boolean;
173
- translations?: {
174
- credits?: string;
175
- balance?: string;
176
- };
177
- style?: ViewStyle;
178
- }
179
- ```
180
-
181
- ## Birlikte Kullanım
182
-
183
- ```typescript
184
- import React from 'react';
185
- import { View, ScrollView } from 'react-native';
186
- import {
187
- PremiumDetailsCard,
188
- PremiumStatusBadge,
189
- DetailRow,
190
- CreditRow,
191
- } from '@umituz/react-native-subscription';
192
-
193
- function SubscriptionDetailsScreen() {
194
- const { subscription, credits } = useSubscription();
195
-
196
- return (
197
- <ScrollView>
198
- {/* Durum Badge */}
199
- <View style={styles.header}>
200
- <PremiumStatusBadge
201
- status={subscription?.type}
202
- size="large"
203
- showIcon={true}
204
- />
205
- </View>
206
-
207
- {/* Detay Kartı */}
208
- <PremiumDetailsCard
209
- status={subscription}
210
- onManagePress={handleManage}
211
- />
212
-
213
- {/* Ek Detaylar */}
214
- <View style={styles.section}>
215
- <DetailRow label="Plan" value="Annual Premium" />
216
- <DetailRow label="Price" value="$79.99/year" />
217
- <DetailRow
218
- label="Status"
219
- value={subscription?.isActive ? 'Active' : 'Inactive'}
220
- valueColor={subscription?.isActive ? 'green' : 'red'}
221
- />
222
- </View>
223
-
224
- {/* Kredi Bakiyesi */}
225
- <View style={styles.section}>
226
- <CreditRow
227
- credits={credits}
228
- currency="USD"
229
- showBalance={true}
230
- />
231
- </View>
232
- </ScrollView>
233
- );
234
- }
235
-
236
- const styles = StyleSheet.create({
237
- header: {
238
- padding: 16,
239
- alignItems: 'center',
240
- },
241
- section: {
242
- padding: 16,
243
- backgroundColor: '#fff',
244
- marginVertical: 8,
245
- },
246
- });
247
- ```
248
-
249
- ## Styling
250
-
251
- Bileşen stilleri özelleştirilebilir:
252
-
253
- ```typescript
254
- import { premiumDetailsCardStyles } from '@umituz/react-native-subscription';
255
-
256
- // Kendi stilınızı kullanın
257
- const customStyles = StyleSheet.create({
258
- container: {
259
- backgroundColor: 'custom-background',
260
- borderRadius: 16,
261
- padding: 20,
262
- shadowColor: '#000',
263
- shadowOffset: { width: 0, height: 2 },
264
- shadowOpacity: 0.25,
265
- shadowRadius: 3.84,
266
- elevation: 5,
267
- },
268
- title: {
269
- fontSize: 24,
270
- fontWeight: 'bold',
271
- color: '#FF6B6B',
272
- },
273
- });
274
-
275
- <PremiumDetailsCard
276
- style={customStyles.container}
277
- status={status}
278
- />
279
- ```
280
-
281
- ## Translations
282
-
283
- Tüm bileşenler çeviri desteği sunar:
284
-
285
- ```typescript
286
- const translations = {
287
- // PremiumDetailsCard
288
- title: 'Premium',
289
- active: 'Active',
290
- inactive: 'Inactive',
291
- expires: 'Expires on',
292
- renews: 'Renews on',
293
- manage: 'Manage Subscription',
294
- upgrade: 'Upgrade to Premium',
295
- lifetime: 'Lifetime Access',
296
-
297
- // PremiumStatusBadge
298
- guest: 'Guest',
299
- free: 'Free',
300
- premium: 'Premium',
301
-
302
- // DetailRow & CreditRow
303
- credits: 'Credits',
304
- balance: 'Balance',
305
- plan: 'Plan',
306
- status: 'Status',
307
- };
308
-
309
- <PremiumDetailsCard
310
- translations={translations}
311
- status={status}
312
- />
313
-
314
- <PremiumStatusBadge
315
- status="premium"
316
- translations={translations}
317
- />
318
- ```
319
-
320
- ## Best Practices
321
-
322
- 1. **Consistent Styling**: Tüm detay bileşenlerinde tutarlı stil kullanın
323
- 2. **Loading States**: Veri yüklenirken loading gösterin
324
- 3. **Error States**: Hata durumlarını kullanıcı dostu gösterin
325
- 4. **Accessibility**: Accessibility özelliklerini ekleyin
326
- 5. **Responsive**: Farklı ekran boyutlarında test edin
327
- 6. **Performance**: Gereksiz re-render'lardan kaçının
328
- 7. **Translations**: Her zaman çeviri desteği sağlayın
329
-
330
- ## Örnek Implementasyon
331
-
332
- ```typescript
333
- import React, { useState } from 'react';
334
- import {
335
- View,
336
- StyleSheet,
337
- ActivityIndicator,
338
- RefreshControl,
339
- } from 'react-native';
340
- import {
341
- PremiumDetailsCard,
342
- PremiumStatusBadge,
343
- DetailRow,
344
- CreditRow,
345
- useSubscription,
346
- useCredits,
347
- } from '@umituz/react-native-subscription';
348
-
349
- export default function MySubscriptionScreen() {
350
- const { subscription, isLoading, refetch } = useSubscription();
351
- const { credits } = useCredits();
352
- const [refreshing, setRefreshing] = useState(false);
353
-
354
- const handleRefresh = async () => {
355
- setRefreshing(true);
356
- await refetch();
357
- setRefreshing(false);
358
- };
359
-
360
- if (isLoading) {
361
- return (
362
- <View style={styles.centered}>
363
- <ActivityIndicator size="large" />
364
- </View>
365
- );
366
- }
367
-
368
- return (
369
- <ScrollView
370
- style={styles.container}
371
- refreshControl={
372
- <RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
373
- }
374
- >
375
- {/* Header */}
376
- <View style={styles.header}>
377
- <PremiumStatusBadge
378
- status={subscription?.type || 'guest'}
379
- size="large"
380
- showIcon={true}
381
- />
382
- </View>
383
-
384
- {/* Premium Details */}
385
- <PremiumDetailsCard
386
- status={subscription}
387
- onManagePress={() => console.log('Manage')}
388
- onUpgradePress={() => console.log('Upgrade')}
389
- style={styles.card}
390
- />
391
-
392
- {/* Additional Details */}
393
- <View style={styles.section}>
394
- <DetailRow
395
- label="Plan"
396
- value={subscription?.productId || 'Free Plan'}
397
- />
398
- <DetailRow
399
- label="Status"
400
- value={subscription?.isActive ? 'Active' : 'Inactive'}
401
- valueColor={subscription?.isActive ? '#4CAF50' : '#F44336'}
402
- />
403
- {subscription?.expirationDate && (
404
- <DetailRow
405
- label="Expires"
406
- value={new Date(subscription.expirationDate).toLocaleDateString()}
407
- />
408
- )}
409
- </View>
410
-
411
- {/* Credits */}
412
- <View style={styles.section}>
413
- <CreditRow
414
- credits={credits}
415
- currency="USD"
416
- showBalance={true}
417
- />
418
- </View>
419
- </ScrollView>
420
- );
421
- }
422
-
423
- const styles = StyleSheet.create({
424
- container: {
425
- flex: 1,
426
- backgroundColor: '#F5F5F5',
427
- },
428
- centered: {
429
- flex: 1,
430
- justifyContent: 'center',
431
- alignItems: 'center',
432
- },
433
- header: {
434
- padding: 20,
435
- alignItems: 'center',
436
- backgroundColor: '#fff',
437
- },
438
- card: {
439
- margin: 16,
440
- },
441
- section: {
442
- backgroundColor: '#fff',
443
- padding: 16,
444
- marginHorizontal: 16,
445
- marginBottom: 16,
446
- borderRadius: 12,
447
- },
448
- });
449
- ```
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)