@umituz/react-native-settings 4.20.58 → 4.20.59

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 (64) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +51 -0
  2. package/.github/ISSUE_TEMPLATE/documentation.md +52 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +63 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +84 -0
  5. package/AI_AGENT_GUIDELINES.md +367 -0
  6. package/ARCHITECTURE.md +246 -0
  7. package/CHANGELOG.md +67 -0
  8. package/CODE_OF_CONDUCT.md +75 -0
  9. package/CONTRIBUTING.md +107 -0
  10. package/DOCUMENTATION_MIGRATION.md +319 -0
  11. package/DOCUMENTATION_TEMPLATE.md +155 -0
  12. package/LICENSE +21 -0
  13. package/README.md +321 -498
  14. package/SECURITY.md +98 -0
  15. package/SETTINGS_SCREEN_GUIDE.md +185 -0
  16. package/TESTING.md +358 -0
  17. package/package.json +13 -2
  18. package/src/application/README.md +85 -271
  19. package/src/domains/about/README.md +85 -440
  20. package/src/domains/about/presentation/hooks/README.md +93 -348
  21. package/src/domains/appearance/README.md +95 -584
  22. package/src/domains/appearance/hooks/README.md +95 -303
  23. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  24. package/src/domains/appearance/presentation/components/README.md +95 -489
  25. package/src/domains/cloud-sync/README.md +73 -439
  26. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  27. package/src/domains/dev/README.md +71 -457
  28. package/src/domains/disclaimer/README.md +77 -411
  29. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  30. package/src/domains/faqs/README.md +86 -574
  31. package/src/domains/feedback/README.md +79 -553
  32. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  33. package/src/domains/legal/README.md +88 -537
  34. package/src/domains/rating/README.md +73 -440
  35. package/src/domains/rating/presentation/components/README.md +95 -475
  36. package/src/domains/video-tutorials/README.md +77 -470
  37. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  38. package/src/infrastructure/README.md +78 -425
  39. package/src/infrastructure/repositories/README.md +88 -420
  40. package/src/infrastructure/services/README.md +74 -460
  41. package/src/presentation/components/README.md +97 -480
  42. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -436
  43. package/src/presentation/components/SettingsFooter/README.md +48 -427
  44. package/src/presentation/components/SettingsItemCard/README.md +152 -391
  45. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  46. package/src/presentation/components/SettingsSection/README.md +47 -401
  47. package/src/presentation/hooks/README.md +95 -389
  48. package/src/presentation/hooks/mutations/README.md +99 -376
  49. package/src/presentation/hooks/queries/README.md +111 -353
  50. package/src/presentation/navigation/README.md +70 -502
  51. package/src/presentation/navigation/components/README.md +70 -295
  52. package/src/presentation/navigation/hooks/README.md +75 -367
  53. package/src/presentation/navigation/utils/README.md +100 -380
  54. package/src/presentation/screens/README.md +53 -504
  55. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  56. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  57. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  58. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  59. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  60. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  61. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  62. package/src/presentation/screens/hooks/README.md +64 -354
  63. package/src/presentation/screens/types/README.md +79 -409
  64. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,399 +1,107 @@
1
1
  # Navigation Hooks
2
2
 
3
- Custom React hooks for navigation utilities and helpers in the settings navigation system.
4
-
5
- ## Hooks
6
-
7
- ### useSettingsNavigation
8
-
9
- Hook providing navigation utilities specific to the settings flow.
10
-
11
- ```tsx
12
- import { useSettingsNavigation } from '@umituz/react-native-settings';
13
-
14
- function SettingsScreen() {
15
- const { navigateToAppearance, navigateToLegal, navigateToAbout } = useSettingsNavigation();
16
-
17
- return (
18
- <Button onPress={() => navigateToAppearance()} title="Go to Appearance" />
19
- );
20
- }
21
- ```
22
-
23
- #### Returns
24
-
25
- ```typescript
26
- interface SettingsNavigationHelpers {
27
- navigateToAppearance: (config?: AppearanceConfig) => void;
28
- navigateToLanguage: (config?: LanguageConfig) => void;
29
- navigateToNotifications: (config?: NotificationsConfig) => void;
30
- navigateToAbout: (config?: AboutConfig) => void;
31
- navigateToLegal: (documentType: LegalDocumentType) => void;
32
- navigateToFeedback: (config?: FeedbackConfig) => void;
33
- navigateToFAQs: (config?: FAQConfig) => void;
34
- navigateToSubscription: (config?: SubscriptionConfig) => void;
35
- navigateToWallet: (config?: WalletConfig) => void;
36
- goBack: () => void;
37
- }
38
- ```
39
-
40
- ## Navigation Helpers
41
-
42
- ### Appearance Navigation
43
-
44
- ```typescript
45
- navigateToAppearance(config?: {
46
- showThemeSection?: boolean;
47
- showColorsSection?: boolean;
48
- showPreviewSection?: boolean;
49
- }): void;
50
- ```
51
-
52
- Navigates to the Appearance settings screen with optional configuration.
53
-
54
- #### Example
55
-
56
- ```tsx
57
- <Button
58
- onPress={() => navigateToAppearance({
59
- showThemeSection: true,
60
- showColorsSection: true,
61
- })}
62
- title="Customize Appearance"
63
- />
64
- ```
65
-
66
- ### Language Navigation
67
-
68
- ```typescript
69
- navigateToLanguage(config?: {
70
- showFlags?: boolean;
71
- }): void;
72
- ```
73
-
74
- Navigates to the Language selection screen.
75
-
76
- #### Example
77
-
78
- ```tsx
79
- <Button
80
- onPress={() => navigateToLanguage({ showFlags: true })}
81
- title="Change Language"
82
- />
83
- ```
84
-
85
- ### Legal Navigation
86
-
87
- ```typescript
88
- navigateToLegal(documentType: 'privacy-policy' | 'terms-of-service' | 'eula'): void;
89
- ```
90
-
91
- Navigates to legal document screens.
92
-
93
- #### Example
94
-
95
- ```tsx
96
- <TouchableOpacity onPress={() => navigateToLegal('privacy-policy')}>
97
- <Text>Privacy Policy</Text>
98
- </TouchableOpacity>
99
- ```
100
-
101
- ### About Navigation
102
-
103
- ```typescript
104
- navigateToAbout(config?: {
105
- appName?: string;
106
- version?: string;
107
- developer?: string;
108
- contactEmail?: string;
109
- }): void;
110
- ```
111
-
112
- Navigates to the About screen with app information.
3
+ ## Purpose
113
4
 
114
- #### Example
115
-
116
- ```tsx
117
- <Button
118
- onPress={() => navigateToAbout({
119
- appName: 'My App',
120
- version: '1.0.0',
121
- })}
122
- title="About"
123
- />
124
- ```
125
-
126
- ### Feedback Navigation
127
-
128
- ```typescript
129
- navigateToFeedback(config?: {
130
- feedbackTypes?: FeedbackType[];
131
- title?: string;
132
- description?: string;
133
- }): void;
134
- ```
135
-
136
- Opens the feedback modal or navigates to feedback screen.
137
-
138
- #### Example
139
-
140
- ```tsx
141
- <Button
142
- onPress={() => navigateToFeedback({
143
- feedbackTypes: ['bug', 'feature', 'general'],
144
- title: 'Send Feedback',
145
- })}
146
- title="Give Feedback"
147
- />
148
- ```
149
-
150
- ### FAQ Navigation
151
-
152
- ```typescript
153
- navigateToFAQs(config?: {
154
- categories?: FAQCategory[];
155
- title?: string;
156
- }): void;
157
- ```
158
-
159
- Navigates to the FAQ screen.
160
-
161
- #### Example
162
-
163
- ```tsx
164
- <Button
165
- onPress={() => navigateToFAQs({
166
- title: 'Help Center',
167
- })}
168
- title="FAQs"
169
- />
170
- ```
171
-
172
- ### Subscription Navigation
173
-
174
- ```typescript
175
- navigateToSubscription(config?: {
176
- title?: string;
177
- description?: string;
178
- onPress?: () => void;
179
- }): void;
180
- ```
181
-
182
- Navigates to subscription or upgrade screen.
183
-
184
- #### Example
185
-
186
- ```tsx
187
- <Button
188
- onPress={() => navigateToSubscription({
189
- title: 'Upgrade to Pro',
190
- description: 'Get all premium features',
191
- })}
192
- title="Upgrade"
193
- />
194
- ```
195
-
196
- ### Wallet Navigation
197
-
198
- ```typescript
199
- navigateToWallet(config?: {
200
- title?: string;
201
- description?: string;
202
- route?: string;
203
- }): void;
204
- ```
205
-
206
- Navigates to wallet/payment settings.
207
-
208
- #### Example
209
-
210
- ```tsx
211
- <Button
212
- onPress={() => navigateToWallet({
213
- title: 'My Wallet',
214
- route: 'WalletScreen',
215
- })}
216
- title="Wallet"
217
- />
218
- ```
219
-
220
- ## Usage Examples
221
-
222
- ### Basic Navigation
223
-
224
- ```tsx
225
- import { useSettingsNavigation } from '@umituz/react-native-settings';
226
-
227
- function SettingsMenu() {
228
- const { navigateToAppearance, navigateToAbout, navigateToLegal } = useSettingsNavigation();
5
+ Custom React hooks for navigation utilities and helpers in the settings navigation system.
229
6
 
230
- return (
231
- <View>
232
- <SettingsItemCard
233
- icon="color-palette-outline"
234
- title="Appearance"
235
- onPress={navigateToAppearance}
236
- />
237
- <SettingsItemCard
238
- icon="information-circle-outline"
239
- title="About"
240
- onPress={navigateToAbout}
241
- />
242
- <SettingsItemCard
243
- icon="document-text-outline"
244
- title="Legal"
245
- onPress={() => navigateToLegal('privacy-policy')}
246
- />
247
- </View>
248
- );
249
- }
250
- ```
7
+ ## File Paths
251
8
 
252
- ### With Configuration
9
+ - **Navigation Hook**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/hooks/useSettingsNavigation.ts`
253
10
 
254
- ```tsx
255
- function SettingsWithOptions() {
256
- const { navigateToAppearance, navigateToLanguage } = useSettingsNavigation();
11
+ ## Strategy
257
12
 
258
- return (
259
- <View>
260
- <SettingsItemCard
261
- icon="moon-outline"
262
- title="Theme"
263
- onPress={() => navigateToAppearance({
264
- showThemeSection: true,
265
- showColorsSection: false,
266
- })}
267
- />
268
- <SettingsItemCard
269
- icon="globe-outline"
270
- title="Language"
271
- onPress={() => navigateToLanguage({ showFlags: true })}
272
- />
273
- </View>
274
- );
275
- }
276
- ```
13
+ 1. **Type-Safe Navigation**: Provides type-safe navigation helpers for all settings screens
14
+ 2. **Config Passing**: Handles configuration passing through navigation params
15
+ 3. **Consistent API**: Uniform navigation methods across all screens
16
+ 4. **Memoization**: Optimizes navigation handlers with useCallback
17
+ 5. **Error Handling**: Includes error handling for navigation failures
277
18
 
278
- ### Conditional Navigation
19
+ ## Restrictions (Forbidden)
279
20
 
280
- ```tsx
281
- function ConditionalNavigation() {
282
- const { navigateToSubscription, navigateToFeedback } = useSettingsNavigation();
283
- const isPremium = useIsPremium();
21
+ ### DO NOT
22
+ - ❌ DO NOT use navigation.navigate() directly (use hook helpers)
23
+ - DO NOT hardcode screen names (use constants from hook)
24
+ - DO NOT bypass type safety with incorrect params
284
25
 
285
- return (
286
- <View>
287
- {!isPremium && (
288
- <SettingsItemCard
289
- icon="star-outline"
290
- title="Upgrade"
291
- onPress={() => navigateToSubscription({
292
- title: 'Go Premium',
293
- description: 'Unlock all features',
294
- })}
295
- />
296
- )}
297
- <SettingsItemCard
298
- icon="chatbubble-outline"
299
- title="Send Feedback"
300
- onPress={() => navigateToFeedback({
301
- feedbackTypes: ['bug', 'feature'],
302
- })}
303
- />
304
- </View>
305
- );
306
- }
307
- ```
26
+ ### NEVER
27
+ - ❌ NEVER use these hooks outside of NavigationContext
28
+ - NEVER pass invalid configuration to navigation helpers
29
+ - ❌ NEVER ignore TypeScript errors for navigation params
308
30
 
309
- ### Custom Navigation Handler
31
+ ### AVOID
32
+ - ❌ AVOID creating multiple navigation hooks (use the provided one)
33
+ - ❌ AVOID complex navigation logic in components (keep in hook)
34
+ - ❌ AVOID navigation side effects in render phase
310
35
 
311
- ```tsx
312
- function CustomNavigation() {
313
- const { navigateToAppearance } = useSettingsNavigation();
36
+ ## Rules (Mandatory)
314
37
 
315
- const handleAppearancePress = useCallback(() => {
316
- // Custom logic before navigation
317
- Analytics.track('appearance_opened');
318
- navigateToAppearance({ showThemeSection: true });
319
- }, [navigateToAppearance]);
38
+ ### ALWAYS
39
+ - ALWAYS use useSettingsNavigation for settings navigation
40
+ - ✅ ALWAYS use proper TypeScript types for config parameters
41
+ - MUST memoize navigation handlers in components
42
+ - ✅ MUST handle navigation errors gracefully
320
43
 
321
- return (
322
- <Button onPress={handleAppearancePress} title="Appearance" />
323
- );
324
- }
325
- ```
44
+ ### MUST
45
+ - MUST provide valid config objects for each screen
46
+ - ✅ MUST check screen availability before navigation (when needed)
47
+ - ✅ MUST use correct parameter types for each screen
326
48
 
327
- ## Navigation Parameters
49
+ ### SHOULD
50
+ - ✅ SHOULD track navigation events for analytics
51
+ - ✅ SHOULD validate configuration before navigation
52
+ - ✅ SHOULD use navigation helpers for consistency
328
53
 
329
- ### Appearance Config
54
+ ## AI Agent Guidelines
330
55
 
331
- ```typescript
332
- interface AppearanceNavConfig {
333
- showThemeSection?: boolean; // Show theme mode selection
334
- showColorsSection?: boolean; // Show custom color selection
335
- showPreviewSection?: boolean; // Show live preview
336
- }
337
- ```
56
+ 1. **File Reference**: When modifying navigation hooks, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/hooks/useSettingsNavigation.ts`
57
+ 2. **Type Safety**: All navigation helpers are type-safe, respect TypeScript types
58
+ 3. **Config Validation**: Validate config objects before passing to navigation helpers
59
+ 4. **Memoization**: Navigation handlers are already memoized, but you can memoize callbacks that use them
60
+ 5. **Analytics**: Track navigation events for insights
338
61
 
339
- ### Language Config
62
+ ## Hook Reference
340
63
 
341
- ```typescript
342
- interface LanguageNavConfig {
343
- showFlags?: boolean; // Show language flags
344
- }
345
- ```
64
+ ### useSettingsNavigation
346
65
 
347
- ### Legal Config
66
+ **Purpose**: Provides type-safe navigation helpers for all settings screens
348
67
 
349
- ```typescript
350
- type LegalDocumentType =
351
- | 'privacy-policy'
352
- | 'terms-of-service'
353
- | 'eula';
68
+ **Returns**: SettingsNavigationHelpers object
354
69
 
355
- interface LegalNavConfig {
356
- documentType: LegalDocumentType;
357
- content?: string; // Custom content
358
- title?: string; // Custom title
359
- }
360
- ```
70
+ **Navigation Methods**:
71
+ - `navigateToAppearance(config?)`: Navigate to Appearance screen
72
+ - `navigateToLanguage(config?)`: Navigate to Language selection screen
73
+ - `navigateToNotifications(config?)`: Navigate to Notifications screen
74
+ - `navigateToAbout(config?)`: Navigate to About screen
75
+ - `navigateToLegal(documentType)`: Navigate to Legal screen
76
+ - `navigateToFeedback(config?)`: Navigate to Feedback screen/modal
77
+ - `navigateToFAQs(config?)`: Navigate to FAQ screen
78
+ - `navigateToSubscription(config?)`: Navigate to Subscription screen
79
+ - `navigateToWallet(config?)`: Navigate to Wallet screen
80
+ - `goBack()`: Navigate back
361
81
 
362
- ### Feedback Config
82
+ **Usage**: Call hook in component, use returned navigation helpers
363
83
 
364
- ```typescript
365
- interface FeedbackNavConfig {
366
- feedbackTypes?: FeedbackType[];
367
- title?: string;
368
- description?: string;
369
- }
370
- ```
84
+ ## Parameter Types
371
85
 
372
- ### FAQ Config
86
+ **AppearanceConfig**: Appearance screen configuration
87
+ - `showThemeSection?: boolean`
88
+ - `showColorsSection?: boolean`
89
+ - `showPreviewSection?: boolean`
373
90
 
374
- ```typescript
375
- interface FAQNavConfig {
376
- categories?: FAQCategory[];
377
- title?: string;
378
- description?: string;
379
- }
380
- ```
91
+ **LanguageConfig**: Language selection configuration
92
+ - `showFlags?: boolean`
381
93
 
382
- ## Best Practices
94
+ **LegalDocumentType**: Legal document type
95
+ - 'privacy-policy' | 'terms-of-service' | 'eula'
383
96
 
384
- 1. **Type Safety**: Always use proper TypeScript types for config
385
- 2. **Memoization**: Memoize navigation handlers for performance
386
- 3. **Analytics**: Track navigation events for insights
387
- 4. **Conditional**: Use conditional navigation based on user state
388
- 5. **Validation**: Validate config before navigation
389
- 6. **Error Handling**: Handle navigation errors gracefully
97
+ **AboutConfig**: About screen configuration
98
+ - `appName?: string`
99
+ - `version?: string`
100
+ - `developer?: string`
101
+ - `contactEmail?: string`
390
102
 
391
- ## Related
103
+ ## Related Components
392
104
 
393
- - **Navigation Components**: Screen wrappers and components
105
+ - **Navigation Components**: Screen wrappers
394
106
  - **Navigation Utils**: Utility functions for navigation
395
107
  - **Screen Components**: Individual screen implementations
396
-
397
- ## License
398
-
399
- MIT