@umituz/react-native-settings 4.20.57 → 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 (65) 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/__tests__/setup.ts +1 -4
  19. package/src/application/README.md +85 -271
  20. package/src/domains/about/README.md +85 -440
  21. package/src/domains/about/presentation/hooks/README.md +93 -348
  22. package/src/domains/appearance/README.md +95 -584
  23. package/src/domains/appearance/hooks/README.md +95 -303
  24. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  25. package/src/domains/appearance/presentation/components/README.md +99 -0
  26. package/src/domains/cloud-sync/README.md +73 -439
  27. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  28. package/src/domains/dev/README.md +71 -457
  29. package/src/domains/disclaimer/README.md +77 -411
  30. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  31. package/src/domains/faqs/README.md +86 -574
  32. package/src/domains/feedback/README.md +79 -553
  33. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  34. package/src/domains/legal/README.md +88 -537
  35. package/src/domains/rating/README.md +73 -440
  36. package/src/domains/rating/presentation/components/README.md +95 -475
  37. package/src/domains/video-tutorials/README.md +77 -470
  38. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  39. package/src/infrastructure/README.md +78 -425
  40. package/src/infrastructure/repositories/README.md +88 -420
  41. package/src/infrastructure/services/README.md +74 -460
  42. package/src/presentation/components/README.md +97 -480
  43. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -442
  44. package/src/presentation/components/SettingsFooter/README.md +48 -427
  45. package/src/presentation/components/SettingsItemCard/README.md +153 -392
  46. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  47. package/src/presentation/components/SettingsSection/README.md +47 -401
  48. package/src/presentation/hooks/README.md +95 -389
  49. package/src/presentation/hooks/mutations/README.md +99 -376
  50. package/src/presentation/hooks/queries/README.md +111 -353
  51. package/src/presentation/navigation/README.md +70 -502
  52. package/src/presentation/navigation/components/README.md +70 -295
  53. package/src/presentation/navigation/hooks/README.md +75 -367
  54. package/src/presentation/navigation/utils/README.md +100 -380
  55. package/src/presentation/screens/README.md +53 -504
  56. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  57. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  58. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  59. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  60. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  61. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  62. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  63. package/src/presentation/screens/hooks/README.md +64 -354
  64. package/src/presentation/screens/types/README.md +79 -409
  65. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,439 +1,109 @@
1
1
  # Settings Screen Types
2
2
 
3
- TypeScript type definitions for settings screen configuration, components, and utilities.
4
-
5
- ## Types
6
-
7
- ### SettingsConfig
8
-
9
- Main configuration object for the settings screen.
10
-
11
- ```typescript
12
- interface SettingsConfig {
13
- appearance?: FeatureVisibility | AppearanceConfig;
14
- language?: FeatureVisibility | LanguageConfig;
15
- notifications?: FeatureVisibility | NotificationsConfig;
16
- about?: FeatureVisibility | AboutConfig;
17
- legal?: FeatureVisibility | LegalConfig;
18
- disclaimer?: FeatureVisibility | DisclaimerConfig;
19
- userProfile?: boolean | UserProfileConfig;
20
- feedback?: FeatureVisibility | FeedbackConfig;
21
- rating?: FeatureVisibility | RatingConfig;
22
- faqs?: FeatureVisibility | FAQConfig;
23
- cloudSync?: FeatureVisibility | CloudSyncConfig;
24
- subscription?: FeatureVisibility | SubscriptionConfig;
25
- wallet?: FeatureVisibility | WalletConfig;
26
- emptyStateText?: string;
27
- }
28
- ```
29
-
30
- #### Usage Examples
31
-
32
- **Simple Configuration:**
33
-
34
- ```typescript
35
- const config: SettingsConfig = {
36
- appearance: true,
37
- language: true,
38
- notifications: 'auto',
39
- about: false,
40
- };
41
- ```
42
-
43
- **Advanced Configuration:**
44
-
45
- ```typescript
46
- const config: SettingsConfig = {
47
- appearance: {
48
- enabled: true,
49
- route: 'CustomAppearance',
50
- showThemeSection: true,
51
- showColorsSection: true,
52
- },
53
- language: {
54
- enabled: 'auto',
55
- route: 'LanguageSelection',
56
- showFlags: true,
57
- },
58
- subscription: {
59
- enabled: true,
60
- title: 'Upgrade to Pro',
61
- onPress: () => navigation.navigate('Upgrade'),
62
- },
63
- };
64
- ```
65
-
66
- ### FeatureVisibility
67
-
68
- Feature enablement type:
69
-
70
- ```typescript
71
- type FeatureVisibility = boolean | 'auto';
72
- ```
73
-
74
- - `true`: Always show feature
75
- - `false`: Never show feature
76
- - `'auto'`: Automatically detect based on navigation
77
-
78
- ### NormalizedConfig
79
-
80
- Normalized configuration with consistent structure:
81
-
82
- ```typescript
83
- interface NormalizedConfig {
84
- appearance: {
85
- enabled: boolean;
86
- config?: AppearanceConfig;
87
- };
88
- language: {
89
- enabled: boolean;
90
- config?: LanguageConfig;
91
- };
92
- notifications: {
93
- enabled: boolean;
94
- config?: NotificationsConfig;
95
- };
96
- // ... other features
97
- }
98
- ```
99
-
100
- ### CustomSettingsSection
101
-
102
- Type for custom settings sections:
103
-
104
- ```typescript
105
- interface CustomSettingsSection {
106
- id?: string;
107
- title: string;
108
- order?: number;
109
- content?: ReactNode;
110
- items?: CustomSettingsItem[];
111
- }
112
- ```
113
-
114
- ### CustomSettingsItem
115
-
116
- Type for custom settings items:
117
-
118
- ```typescript
119
- interface CustomSettingsItem {
120
- id?: string;
121
- title: string;
122
- subtitle?: string;
123
- icon: IconName;
124
- onPress?: () => void;
125
- rightIcon?: IconName;
126
- iconBgColor?: string;
127
- iconColor?: string;
128
- }
129
- ```
130
-
131
- ## Content Configuration Types
132
-
133
- ### AppearanceConfig
134
-
135
- ```typescript
136
- interface AppearanceConfig {
137
- enabled?: FeatureVisibility;
138
- route?: string;
139
- showThemeSection?: boolean;
140
- showColorsSection?: boolean;
141
- showPreviewSection?: boolean;
142
- }
143
- ```
144
-
145
- ### LanguageConfig
146
-
147
- ```typescript
148
- interface LanguageConfig {
149
- enabled?: FeatureVisibility;
150
- route?: string;
151
- showFlags?: boolean;
152
- }
153
- ```
154
-
155
- ### NotificationsConfig
3
+ ## Purpose
156
4
 
157
- ```typescript
158
- interface NotificationsConfig {
159
- enabled?: FeatureVisibility;
160
- route?: string;
161
- showQuietHours?: boolean;
162
- showCategories?: boolean;
163
- }
164
- ```
165
-
166
- ### AboutConfig
167
-
168
- ```typescript
169
- interface AboutConfig {
170
- enabled?: FeatureVisibility;
171
- route?: string;
172
- appName?: string;
173
- version?: string;
174
- buildNumber?: string;
175
- developer?: string;
176
- contactEmail?: string;
177
- websiteUrl?: string;
178
- websiteDisplay?: string;
179
- moreAppsUrl?: string;
180
- }
181
- ```
182
-
183
- ### LegalConfig
184
-
185
- ```typescript
186
- interface LegalConfig {
187
- enabled?: FeatureVisibility;
188
- route?: string;
189
- showPrivacy?: boolean;
190
- showTerms?: boolean;
191
- showEula?: boolean;
192
- privacyPolicyUrl?: string;
193
- termsOfServiceUrl?: string;
194
- eulaUrl?: string;
195
- }
196
- ```
197
-
198
- ### DisclaimerConfig
199
-
200
- ```typescript
201
- interface DisclaimerConfig {
202
- enabled?: FeatureVisibility;
203
- route?: string;
204
- title?: string;
205
- message?: string;
206
- shortMessage?: string;
207
- }
208
- ```
209
-
210
- ## User Feature Types
211
-
212
- ### UserProfileConfig
213
-
214
- ```typescript
215
- interface UserProfileConfig {
216
- displayName?: string;
217
- userId?: string;
218
- isAnonymous?: boolean;
219
- avatarUrl?: string;
220
- accountSettingsRoute?: string;
221
- onPress?: () => void;
222
- anonymousDisplayName?: string;
223
- avatarServiceUrl?: string;
224
- }
225
- ```
226
-
227
- ### FeedbackConfig
228
-
229
- ```typescript
230
- interface FeedbackConfig {
231
- enabled?: FeatureVisibility;
232
- title?: string;
233
- description?: string;
234
- feedbackTypes?: FeedbackType[];
235
- }
236
- ```
237
-
238
- ### RatingConfig
239
-
240
- ```typescript
241
- interface RatingConfig {
242
- enabled?: FeatureVisibility;
243
- title?: string;
244
- description?: string;
245
- storeUrl?: string;
246
- }
247
- ```
248
-
249
- ### FAQConfig
250
-
251
- ```typescript
252
- interface FAQConfig {
253
- enabled?: FeatureVisibility;
254
- title?: string;
255
- description?: string;
256
- categories?: FAQCategory[];
257
- }
258
- ```
259
-
260
- ### SubscriptionConfig
261
-
262
- ```typescript
263
- interface SubscriptionConfig {
264
- enabled?: FeatureVisibility;
265
- title?: string;
266
- description?: string;
267
- icon?: string;
268
- onPress?: () => void;
269
- sectionTitle?: string;
270
- }
271
- ```
272
-
273
- ### WalletConfig
274
-
275
- ```typescript
276
- interface WalletConfig {
277
- enabled?: FeatureVisibility;
278
- title?: string;
279
- description?: string;
280
- icon?: string;
281
- route?: string;
282
- sectionTitle?: string;
283
- }
284
- ```
285
-
286
- ### CloudSyncConfig
287
-
288
- ```typescript
289
- interface CloudSyncConfig {
290
- enabled?: FeatureVisibility;
291
- title?: string;
292
- description?: string;
293
- }
294
- ```
295
-
296
- ## Base Types
297
-
298
- ### BaseTypes.ts
299
-
300
- ```typescript
301
- type FeatureVisibility = boolean | 'auto';
302
- ```
303
-
304
- ### ContentConfig.ts
305
-
306
- ```typescript
307
- export interface AppearanceConfig { ... }
308
- export interface LanguageConfig { ... }
309
- export interface NotificationsConfig { ... }
310
- export interface AboutConfig { ... }
311
- export interface LegalConfig { ... }
312
- export interface DisclaimerConfig { ... }
313
- ```
314
-
315
- ### UserFeatureConfig.ts
5
+ TypeScript type definitions for settings screen configuration, components, and utilities.
316
6
 
317
- ```typescript
318
- export interface UserProfileConfig { ... }
319
- export interface FeedbackConfig { ... }
320
- export interface RatingConfig { ... }
321
- export interface FAQConfig { ... }
322
- export interface CloudSyncConfig { ... }
323
- export interface SubscriptionConfig { ... }
324
- export interface WalletConfig { ... }
325
- ```
7
+ ## File Paths
326
8
 
327
- ## Type Guards
9
+ - **Base Types**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/BaseTypes.ts`
10
+ - **Content Config**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/ContentConfig.ts`
11
+ - **User Features**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/UserFeatureConfig.ts`
12
+ - **Custom Sections**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/CustomSection.ts`
13
+ - **Settings Config**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/SettingsConfig.ts`
14
+ - **Index**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/index.ts`
328
15
 
329
- ### Checking Config Type
16
+ ## Strategy
330
17
 
331
- ```typescript
332
- function isAppearanceConfig(
333
- value: FeatureVisibility | AppearanceConfig
334
- ): value is AppearanceConfig {
335
- return typeof value === 'object' && value !== null;
336
- }
18
+ 1. **Type Safety**: Provides comprehensive TypeScript types for all settings functionality
19
+ 2. **Config Validation**: Ensures configuration objects are properly typed
20
+ 3. **Modular Organization**: Separates types by feature domain
21
+ 4. **Reusability**: Exports types for use across the application
22
+ 5. **Documentation**: Types serve as inline documentation
337
23
 
338
- // Usage
339
- if (isAppearanceConfig(config.appearance)) {
340
- console.log(config.appearance.route); // TypeScript knows this exists
341
- }
342
- ```
24
+ ## Restrictions (Forbidden)
343
25
 
344
- ### Checking Feature Enabled
26
+ ### DO NOT
27
+ - ❌ DO NOT use `any` type for configuration objects
28
+ - ❌ DO NOT bypass type checking with type assertions
29
+ - ❌ DO NOT create duplicate type definitions
345
30
 
346
- ```typescript
347
- function isFeatureEnabled(
348
- value: FeatureVisibility | any
349
- ): boolean {
350
- if (value === 'auto') return true; // Will be detected
351
- if (typeof value === 'boolean') return value;
352
- if (value?.enabled === 'auto') return true;
353
- return value?.enabled === true;
354
- }
31
+ ### NEVER
32
+ - ❌ NEVER use config objects without proper typing
33
+ - NEVER assume optional properties exist without checking
34
+ - NEVER mix config types (e.g., pass AppearanceConfig where LanguageConfig expected)
355
35
 
356
- // Usage
357
- if (isFeatureEnabled(config.appearance)) {
358
- // Feature is enabled
359
- }
360
- ```
36
+ ### AVOID
37
+ - AVOID creating overly complex nested types
38
+ - AVOID circular type dependencies
39
+ - ❌ AVOID type definitions that don't match actual usage
361
40
 
362
- ## Type Exports
41
+ ## Rules (Mandatory)
363
42
 
364
- All types are exported from:
43
+ ### ALWAYS
44
+ - ✅ ALWAYS use proper TypeScript types for config objects
45
+ - ✅ ALWAYS use type guards for checking config object types
46
+ - ✅ MUST provide type exports for public API
47
+ - ✅ MUST keep types in sync with actual usage
365
48
 
366
- ```typescript
367
- // types/index.ts
368
- export * from './BaseTypes';
369
- export * from './ContentConfig';
370
- export * from './UserFeatureConfig';
371
- export * from './CustomSection';
372
- export * from './SettingsConfig';
373
- ```
49
+ ### MUST
50
+ - ✅ MUST use FeatureVisibility type for feature enablement
51
+ - MUST validate config at runtime when needed
52
+ - MUST use proper generics for reusable types
374
53
 
375
- ## Usage Examples
54
+ ### SHOULD
55
+ - ✅ SHOULD use type aliases for common patterns
56
+ - ✅ SHOULD document complex types with comments
57
+ - ✅ SHOULD keep types simple and focused
376
58
 
377
- ### Type-Safe Config
59
+ ## AI Agent Guidelines
378
60
 
379
- ```typescript
380
- import type { SettingsConfig, AppearanceConfig } from '@umituz/react-native-settings';
61
+ 1. **File Reference**: When modifying types, refer to files in `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/`
62
+ 2. **Type Safety**: Always use types from this module, never create inline types
63
+ 3. **FeatureVisibility**: Understand the three values: true (enabled), false (disabled), 'auto' (detect)
64
+ 4. **Type Guards**: Use type guards to safely check config object types
65
+ 5. **Exports**: Import types from the main index file for consistency
381
66
 
382
- const config: SettingsConfig = {
383
- appearance: {
384
- enabled: true,
385
- route: 'CustomAppearance',
386
- showThemeSection: true,
387
- showColorsSection: false,
388
- },
389
- };
390
- ```
67
+ ## Type Reference
391
68
 
392
- ### Custom Section Type
69
+ ### Core Types
393
70
 
394
- ```typescript
395
- import type { CustomSettingsSection } from '@umituz/react-native-settings';
71
+ **FeatureVisibility**: `boolean | 'auto'`
72
+ - true: Always show feature
73
+ - false: Never show feature
74
+ - 'auto': Automatically detect based on navigation
396
75
 
397
- const customSection: CustomSettingsSection = {
398
- id: 'custom',
399
- title: 'CUSTOM SECTION',
400
- order: 1,
401
- items: [
402
- {
403
- id: 'item1',
404
- title: 'Custom Item',
405
- icon: 'settings-outline',
406
- onPress: () => console.log('Pressed'),
407
- },
408
- ],
409
- };
410
- ```
76
+ **SettingsConfig**: Main configuration interface with all features
77
+ - Supports boolean, 'auto', or object config for each feature
411
78
 
412
- ### Type Inference
79
+ **NormalizedConfig**: Normalized structure with enabled flags and config objects
80
+ - Consistent format for all features
81
+ - Used internally after normalization
413
82
 
414
- ```typescript
415
- import { normalizeSettingsConfig } from '@umituz/react-native-settings';
416
- import type { NormalizedConfig } from '@umituz/react-native-settings';
83
+ ### Feature Config Types
417
84
 
418
- const normalized: NormalizedConfig = normalizeSettingsConfig(config);
419
- ```
85
+ **AppearanceConfig**: Appearance settings configuration
86
+ **LanguageConfig**: Language selection configuration
87
+ **NotificationsConfig**: Notification settings configuration
88
+ **AboutConfig**: About screen configuration
89
+ **LegalConfig**: Legal screen configuration
420
90
 
421
- ## Best Practices
91
+ ### User Feature Types
422
92
 
423
- 1. **Type Safety**: Always use proper TypeScript types
424
- 2. **Type Guards**: Use type guards for config objects
425
- 3. **Defaults**: Provide sensible defaults for all config
426
- 4. **Validation**: Validate config at runtime
427
- 5. **Documentation**: Document custom config objects
428
- 6. **Type Exports**: Use centralized type exports
429
- 7. **Generic Types**: Leverage generics for reusability
93
+ **UserProfileConfig**: User profile display configuration
94
+ **FeedbackConfig**: Feedback functionality configuration
95
+ **RatingConfig**: App rating prompt configuration
96
+ **FAQConfig**: FAQ section configuration
97
+ **SubscriptionConfig**: Subscription/upgrade configuration
98
+ **WalletConfig**: Wallet settings configuration
430
99
 
431
- ## Related
100
+ ### Custom Types
432
101
 
433
- - **normalizeConfig**: Config normalization utilities
434
- - **useFeatureDetection**: Feature detection hook
435
- - **SettingsScreen**: Main screen component
102
+ **CustomSettingsSection**: Custom section definition
103
+ **CustomSettingsItem**: Custom item within a section
436
104
 
437
- ## License
105
+ ## Related Components
438
106
 
439
- MIT
107
+ - **normalizeSettingsConfig**: Uses these types for normalization
108
+ - **SettingsScreen**: Uses these types for props
109
+ - **useFeatureDetection**: Uses these types for feature flags