@umituz/react-native-settings 4.20.58 → 4.20.60

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 (68) 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/SettingsStackNavigator.tsx +2 -0
  52. package/src/presentation/navigation/components/README.md +70 -295
  53. package/src/presentation/navigation/components/wrappers/SettingsScreenWrapper.tsx +3 -0
  54. package/src/presentation/navigation/hooks/README.md +75 -367
  55. package/src/presentation/navigation/types.ts +1 -0
  56. package/src/presentation/navigation/utils/README.md +100 -380
  57. package/src/presentation/screens/README.md +53 -504
  58. package/src/presentation/screens/SettingsScreen.tsx +4 -2
  59. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  60. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  61. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  62. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  63. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  64. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  65. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  66. package/src/presentation/screens/hooks/README.md +64 -354
  67. package/src/presentation/screens/types/README.md +79 -409
  68. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,404 +1,75 @@
1
1
  # Settings Content
2
2
 
3
- Main content composer component that orchestrates all sections of the settings screen including profile, features, identity, support, and footer.
4
-
5
- ## Features
6
-
7
- - **Section Composition**: Orchestrates all settings sections
8
- - **Profile Header**: Optional user profile display
9
- - **Custom Sections**: Support for app-specific sections
10
- - **Feature Sections**: Appearance, language, notifications
11
- - **Identity Sections**: About and legal information
12
- - **Support Sections**: Feedback, rating, and FAQs
13
- - **Empty State**: Graceful handling of empty configuration
14
- - **Footer**: App version and build information
15
-
16
- ## Installation
17
-
18
- This component is part of `@umituz/react-native-settings`.
19
-
20
- ## Usage
21
-
22
- ### Basic Usage
23
-
24
- ```tsx
25
- import { SettingsContent } from '@umituz/react-native-settings';
26
-
27
- function MySettingsScreen() {
28
- const normalizedConfig = {
29
- appearance: { config: {} },
30
- language: { config: {} },
31
- notifications: { config: {} },
32
- about: { config: {} },
33
- legal: { config: {} },
34
- feedback: { config: {} },
35
- };
36
-
37
- const features = {
38
- appearance: true,
39
- language: true,
40
- notifications: true,
41
- about: true,
42
- legal: true,
43
- feedback: true,
44
- };
45
-
46
- return (
47
- <SettingsContent
48
- normalizedConfig={normalizedConfig}
49
- features={features}
50
- showFooter={true}
51
- appVersion="1.0.0"
52
- />
53
- );
54
- }
55
- ```
56
-
57
- ## Props
58
-
59
- ### SettingsContentProps
60
-
61
- | Prop | Type | Default | Description |
62
- |------|------|---------|-------------|
63
- | `normalizedConfig` | `NormalizedConfig` | **Required** | Normalized configuration object |
64
- | `config` | `any` | `undefined` | Raw config object |
65
- | `features` | `FeatureFlags` | **Required** | Feature visibility flags |
66
- | `showUserProfile` | `boolean` | `false` | Show user profile header |
67
- | `userProfile` | `UserProfile` | `undefined` | User profile data |
68
- | `showFooter` | `boolean` | `true` | Show footer with version |
69
- | `footerText` | `string` | `undefined` | Custom footer text |
70
- | `appVersion` | `string` | `undefined` | App version number |
71
- | `customSections` | `CustomSection[]` | `[]` | Custom settings sections |
72
- | `showCloseButton` | `boolean` | `false` | Show close button (unused) |
73
- | `devSettings` | `DevSettingsProps` | `undefined` | Dev settings configuration |
74
-
75
- ### FeatureFlags
76
-
77
- ```typescript
78
- interface FeatureFlags {
79
- appearance: boolean; // Show appearance settings
80
- language: boolean; // Show language selection
81
- notifications: boolean; // Show notification settings
82
- about: boolean; // Show about section
83
- legal: boolean; // Show legal section
84
- disclaimer: boolean; // Show disclaimer
85
- userProfile: boolean; // Show user profile
86
- feedback: boolean; // Show feedback option
87
- rating: boolean; // Show rating option
88
- faqs: boolean; // Show FAQ access
89
- subscription: boolean; // Show subscription option
90
- wallet: boolean; // Show wallet option
91
- }
92
- ```
93
-
94
- ## Component Structure
95
-
96
- ```
97
- SettingsContent
98
- ├── ProfileSectionLoader (if showUserProfile)
99
- ├── CustomSettingsList (if customSections)
100
- ├── Subscription Item (if features.subscription)
101
- ├── Wallet Item (if features.wallet)
102
- ├── FeatureSettingsSection
103
- │ ├── AppearanceSection (if features.appearance)
104
- │ ├── Language Selection (if features.language)
105
- │ └── NotificationsSection (if features.notifications)
106
- ├── IdentitySettingsSection
107
- │ ├── AboutSection (if features.about)
108
- │ └── LegalSection (if features.legal)
109
- ├── SupportSettingsSection
110
- │ ├── Feedback (if features.feedback)
111
- │ ├── Rating (if features.rating)
112
- │ └── FAQ (if features.faqs)
113
- ├── DisclaimerSetting (if features.disclaimer)
114
- ├── Empty State (if no features)
115
- ├── DevSettingsSection (if devSettings)
116
- └── SettingsFooter (if showFooter)
117
- ```
118
-
119
- ## Examples
120
-
121
- ### Minimal Settings
122
-
123
- ```tsx
124
- function MinimalSettings() {
125
- return (
126
- <SettingsContent
127
- normalizedConfig={{}}
128
- features={{}}
129
- showFooter={true}
130
- />
131
- );
132
- }
133
- ```
134
-
135
- ### With User Profile
136
-
137
- ```tsx
138
- function SettingsWithProfile() {
139
- const userProfile = {
140
- displayName: 'John Doe',
141
- userId: 'user123',
142
- avatarUrl: 'https://example.com/avatar.jpg',
143
- onPress: () => navigation.navigate('Account'),
144
- };
145
-
146
- return (
147
- <SettingsContent
148
- normalizedConfig={{}}
149
- features={{ userProfile: true }}
150
- showUserProfile={true}
151
- userProfile={userProfile}
152
- />
153
- );
154
- }
155
- ```
156
-
157
- ### Full Featured Settings
158
-
159
- ```tsx
160
- function FullSettings() {
161
- const normalizedConfig = {
162
- appearance: { config: { showThemeSection: true } },
163
- language: { config: { route: 'LanguageSelection' } },
164
- notifications: { config: { showQuietHours: true } },
165
- about: {
166
- config: {
167
- appName: 'My App',
168
- version: '1.0.0',
169
- developer: 'My Company',
170
- },
171
- },
172
- legal: {
173
- config: {
174
- privacyPolicyUrl: 'https://example.com/privacy',
175
- termsOfServiceUrl: 'https://example.com/terms',
176
- },
177
- },
178
- subscription: {
179
- config: {
180
- title: 'Upgrade to Pro',
181
- description: 'Get all features',
182
- onPress: () => navigation.navigate('Upgrade'),
183
- },
184
- },
185
- };
3
+ ## Purpose
186
4
 
187
- const features = {
188
- appearance: true,
189
- language: true,
190
- notifications: true,
191
- about: true,
192
- legal: true,
193
- disclaimer: true,
194
- feedback: true,
195
- rating: true,
196
- faqs: true,
197
- subscription: true,
198
- };
199
-
200
- return (
201
- <SettingsContent
202
- normalizedConfig={normalizedConfig}
203
- features={features}
204
- showUserProfile={true}
205
- userProfile={userProfile}
206
- showFooter={true}
207
- appVersion="1.0.0"
208
- />
209
- );
210
- }
211
- ```
212
-
213
- ### With Custom Sections
214
-
215
- ```tsx
216
- function SettingsWithCustomSections() {
217
- const customSections = [
218
- {
219
- title: 'INTEGRATIONS',
220
- items: [
221
- {
222
- title: 'Google',
223
- icon: 'logo-google',
224
- onPress: () => manageGoogle(),
225
- },
226
- ],
227
- },
228
- ];
229
-
230
- return (
231
- <SettingsContent
232
- normalizedConfig={{}}
233
- features={{}}
234
- customSections={customSections}
235
- />
236
- );
237
- }
238
- ```
239
-
240
- ### With Dev Settings
241
-
242
- ```tsx
243
- import { DevSettingsSection } from '@umituz/react-native-settings';
244
-
245
- function DevelopmentSettings() {
246
- return (
247
- <SettingsContent
248
- normalizedConfig={{}}
249
- features={{}}
250
- devSettings={{
251
- enabled: true,
252
- onAfterClear: async () => {
253
- await resetApp();
254
- Updates.reloadAsync();
255
- },
256
- }}
257
- />
258
- );
259
- }
260
- ```
261
-
262
- ### Custom Footer Text
263
-
264
- ```tsx
265
- function CustomFooterSettings() {
266
- return (
267
- <SettingsContent
268
- normalizedConfig={{}}
269
- features={{}}
270
- showFooter={true}
271
- footerText="© 2025 My Company. All rights reserved."
272
- />
273
- );
274
- }
275
- ```
276
-
277
- ## Empty State
278
-
279
- When no features are enabled, shows empty state:
280
-
281
- ```tsx
282
- // Renders empty state section
283
- <SettingsContent
284
- normalizedConfig={{}}
285
- features={{}}
286
- />
287
- ```
288
-
289
- Empty state text can be customized via `config.emptyStateText` or translation key `settings.noOptionsAvailable`.
290
-
291
- ## Sub-Components
292
-
293
- ### ProfileSectionLoader
294
-
295
- Loads and displays user profile header.
296
-
297
- ```tsx
298
- <ProfileSectionLoader userProfile={userProfile} />
299
- ```
300
-
301
- ### CustomSettingsList
302
-
303
- Renders custom app-specific sections.
304
-
305
- ```tsx
306
- <CustomSettingsList customSections={customSections} />
307
- ```
308
-
309
- ### Subscription Item
310
-
311
- Special item for subscription/upgrade.
312
-
313
- ```tsx
314
- <SettingsItemCard
315
- title="Upgrade to Pro"
316
- description="Get all features"
317
- icon="star"
318
- onPress={handleUpgrade}
319
- sectionTitle="SUBSCRIPTION"
320
- />
321
- ```
5
+ Main content composer component that orchestrates all sections of the settings screen including profile, features, identity, support, and footer.
322
6
 
323
- ### Wallet Item
7
+ ## File Paths
324
8
 
325
- Special item for wallet/payment settings.
9
+ - **Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsContent/SettingsContent.tsx`
326
10
 
327
- ```tsx
328
- <WalletSettingsItem
329
- config={{
330
- title: 'Wallet',
331
- description: 'Manage payment',
332
- icon: 'wallet',
333
- route: 'Wallet',
334
- }}
335
- t={t}
336
- />
337
- ```
11
+ ## Strategy
338
12
 
339
- ## Feature Detection
13
+ 1. **Section Orchestration**: Manages rendering of all settings sections in defined order
14
+ 2. **Feature Flags**: Uses feature flags to control section visibility
15
+ 3. **Empty State**: Gracefully handles configuration with no enabled features
16
+ 4. **Custom Sections**: Supports app-specific custom sections
17
+ 5. **Footer Integration**: Includes app version and build information footer
340
18
 
341
- Uses `hasAnyFeatures` to determine if empty state should be shown:
19
+ ## Restrictions (Forbidden)
342
20
 
343
- ```typescript
344
- const hasAnyFeatures = useMemo(() =>
345
- features.appearance ||
346
- features.language ||
347
- features.notifications ||
348
- features.about ||
349
- features.legal ||
350
- features.disclaimer ||
351
- features.feedback ||
352
- features.rating ||
353
- features.faqs ||
354
- features.subscription ||
355
- features.wallet ||
356
- customSections.length > 0,
357
- [features, customSections.length]
358
- );
359
- ```
21
+ ### DO NOT
22
+ - DO NOT manually render sections individually (use SettingsContent for all)
23
+ - ❌ DO NOT bypass normalized config system
24
+ - ❌ DO NOT modify section order after initial render
360
25
 
361
- ## Internationalization
26
+ ### NEVER
27
+ - ❌ NEVER pass non-normalized config to SettingsContent
28
+ - ❌ NEVER use SettingsContent without feature detection
29
+ - ❌ NEVER hardcode section visibility
362
30
 
363
- Translation keys used:
31
+ ### AVOID
32
+ - ❌ AVOID showing too many sections at once (impacts performance)
33
+ - ❌ AVOID frequent re-renders by keeping config stable
34
+ - ❌ AVOID mixing concerns (keep section logic in section components)
364
35
 
365
- ```typescript
366
- // Section titles
367
- t("settings.title")
36
+ ## Rules (Mandatory)
368
37
 
369
- // Subscription
370
- t("settings.subscription.title")
371
- t("settings.subscription.description")
38
+ ### ALWAYS
39
+ - ✅ ALWAYS normalize config before passing to SettingsContent
40
+ - ✅ ALWAYS use feature flags to control visibility
41
+ - ✅ ALWAYS provide feature flags from useFeatureDetection hook
42
+ - ✅ MUST handle empty state when no features are enabled
372
43
 
373
- // Wallet
374
- t("wallet.title")
375
- t("wallet.description")
44
+ ### MUST
45
+ - ✅ MUST maintain section order: Profile → Custom → Features → Identity → Support → Footer
46
+ - ✅ MUST memoize section components for performance
47
+ - ✅ MUST provide translation function via context or props
376
48
 
377
- // Footer
378
- t("settings.footer.version")
49
+ ### SHOULD
50
+ - ✅ SHOULD keep sections focused on specific feature groups
51
+ - ✅ SHOULD use custom sections for app-specific features
52
+ - ✅ SHOULD test with various feature combinations
379
53
 
380
- // Empty state
381
- t("settings.noOptionsAvailable")
382
- ```
54
+ ## AI Agent Guidelines
383
55
 
384
- ## Best Practices
56
+ 1. **File Reference**: When modifying content structure, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsContent/SettingsContent.tsx`
57
+ 2. **Config Normalization**: Always call `normalizeSettingsConfig()` before passing to component
58
+ 3. **Feature Detection**: Always use `useFeatureDetection()` hook to generate feature flags
59
+ 4. **Performance**: Component uses useMemo to prevent unnecessary recalculations
60
+ 5. **Empty State**: Provide meaningful empty state message via translation key `settings.noOptionsAvailable`
385
61
 
386
- 1. **Normalize Config**: Always normalize config before passing
387
- 2. **Feature Flags**: Use feature flags to control visibility
388
- 3. **Order Matters**: Sections render in defined order
389
- 4. **User Profile**: Show profile only for authenticated users
390
- 5. **Footer Info**: Always include app version in footer
391
- 6. **Empty State**: Provide meaningful empty state message
392
- 7. **Dev Settings**: Include dev settings for development builds
393
- 8. **Custom Sections**: Use custom sections for app-specific features
62
+ ## Component Reference
394
63
 
395
- ## Related
64
+ Sub-components managed:
65
+ - **ProfileSectionLoader**: User profile header (conditional)
66
+ - **CustomSettingsList**: App-specific custom sections
67
+ - **FeatureSettingsSection**: Appearance, Language, Notifications
68
+ - **IdentitySettingsSection**: About, Legal
69
+ - **SupportSettingsSection**: Feedback, Rating, FAQs
70
+ - **SettingsFooter**: App version and build info
396
71
 
72
+ Related:
397
73
  - **SettingsScreen**: Main screen component
398
74
  - **SettingsHeader**: Header component
399
- - **ProfileSectionLoader**: Profile component
400
- - **Feature Sections**: Individual section components
401
-
402
- ## License
403
-
404
- MIT
75
+ - **useFeatureDetection**: Hook for feature detection