@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,445 +1,90 @@
1
1
  # About Domain
2
2
 
3
- The About domain provides components and utilities for displaying app information, user details, version info, and contact information in your React Native app.
4
-
5
- ## Features
6
-
7
- - **App Information Display**: Show app name, version, and build number
8
- - **Contact Information**: Display developer, email, and website details
9
- - **Customizable Actions**: Handle taps on email, website, and other links
10
- - **Localized Texts**: Support for custom labels and messages
11
- - **Loading & Error States**: Built-in loading and error handling
12
- - **Fully Typed**: Complete TypeScript support
13
-
14
- ## Installation
15
-
16
- This domain is part of `@umituz/react-native-settings`. Install the package to use it:
17
-
18
- ```bash
19
- npm install @umituz/react-native-settings
20
- ```
21
-
22
- ## Components
23
-
24
- ### AboutScreen
25
-
26
- The main screen component for displaying app information.
27
-
28
- ```tsx
29
- import { AboutScreen } from '@umituz/react-native-settings';
30
-
31
- function MyAboutScreen() {
32
- const config = {
33
- appName: 'My App',
34
- version: '1.0.0',
35
- buildNumber: '100',
36
- developer: 'Acme Inc',
37
- contactEmail: 'support@acme.com',
38
- websiteUrl: 'https://acme.com',
39
- actions: {
40
- onEmailPress: () => Linking.openURL('mailto:support@acme.com'),
41
- onWebsitePress: () => Linking.openURL('https://acme.com'),
42
- },
43
- texts: {
44
- versionPrefix: 'Version',
45
- contact: 'Contact Us',
46
- developer: 'Developer',
47
- email: 'Email',
48
- website: 'Website',
49
- },
50
- };
51
-
52
- return <AboutScreen config={config} />;
53
- }
54
- ```
55
-
56
- #### Props
57
-
58
- | Prop | Type | Default | Description |
59
- |------|------|---------|-------------|
60
- | `config` | `AboutConfig` | **Required** | Configuration object with app info |
61
- | `containerStyle` | `ViewStyle` | `undefined` | Custom container style |
62
- | `headerStyle` | `ViewStyle` | `undefined` | Custom header style |
63
- | `titleStyle` | `TextStyle` | `undefined` | Custom title style |
64
- | `versionStyle` | `TextStyle` | `undefined` | Custom version style |
65
- | `showHeader` | `boolean` | `true` | Show app header with name and version |
66
- | `headerComponent` | `ReactNode` | `undefined` | Custom header component |
67
- | `footerComponent` | `ReactNode` | `undefined` | Custom footer component |
68
- | `testID` | `string` | `undefined` | Test ID for E2E testing |
69
-
70
- ### AboutContent
71
-
72
- Displays the list of about items organized in sections.
73
-
74
- ```tsx
75
- import { AboutContent } from '@umituz/react-native-settings';
76
-
77
- function MyAboutContent() {
78
- const appInfo = {
79
- appName: 'My App',
80
- version: '1.0.0',
81
- developer: 'Acme Inc',
82
- contactEmail: 'support@acme.com',
83
- };
84
-
85
- const config = {
86
- actions: {
87
- onEmailPress: () => console.log('Email pressed'),
88
- },
89
- };
90
-
91
- return <AboutContent appInfo={appInfo} config={config} />;
92
- }
93
- ```
94
-
95
- #### Props
96
-
97
- | Prop | Type | Default | Description |
98
- |------|------|---------|-------------|
99
- | `appInfo` | `AppInfo` | **Required** | App information to display |
100
- | `config` | `AboutConfig` | **Required** | Configuration for actions |
101
-
102
- ### AboutSection
103
-
104
- Renders a section of related about items.
105
-
106
- ```tsx
107
- import { AboutSection } from '@umituz/react-native-settings';
108
-
109
- function ContactSection() {
110
- const items = [
111
- {
112
- title: 'Developer',
113
- value: 'Acme Inc',
114
- },
115
- {
116
- title: 'Email',
117
- value: 'support@acme.com',
118
- onPress: () => Linking.openURL('mailto:support@acme.com'),
119
- },
120
- ];
121
-
122
- return <AboutSection title="Contact" items={items} />;
123
- }
124
- ```
125
-
126
- ### AboutSettingItem
127
-
128
- Individual setting item with title, value, and optional press handler.
129
-
130
- ```tsx
131
- import { AboutSettingItem } from '@umituz/react-native-settings';
132
-
133
- function EmailItem() {
134
- return (
135
- <AboutSettingItem
136
- title="Email"
137
- value="support@acme.com"
138
- onPress={() => Linking.openURL('mailto:support@acme.com')}
139
- showChevron={true}
140
- />
141
- );
142
- }
143
- ```
144
-
145
- #### Props
146
-
147
- | Prop | Type | Default | Description |
148
- |------|------|---------|-------------|
149
- | `title` | `string` | **Required** | Item title |
150
- | `value` | `string` | `undefined` | Item value to display |
151
- | `onPress` | `() => void` | `undefined` | Press handler |
152
- | `showChevron` | `boolean` | `false` | Show navigation chevron |
153
- | `testID` | `string` | `undefined` | Test ID for testing |
154
-
155
- ### AboutHeader
156
-
157
- Header component displaying app name and version.
158
-
159
- ```tsx
160
- import { AboutHeader } from '@umituz/react-native-settings';
161
-
162
- function MyAboutHeader() {
163
- const appInfo = {
164
- appName: 'My App',
165
- version: '1.0.0',
166
- };
167
-
168
- return <AboutHeader appInfo={appInfo} />;
169
- }
170
- ```
171
-
172
- #### Props
173
-
174
- | Prop | Type | Default | Description |
175
- |------|------|---------|-------------|
176
- | `appInfo` | `AppInfo` | **Required** | App information |
177
- | `containerStyle` | `ViewStyle` | `undefined` | Custom container style |
178
- | `titleStyle` | `TextStyle` | `undefined` | Custom title style |
179
- | `versionStyle` | `TextStyle` | `undefined` | Custom version style |
180
- | `versionPrefix` | `string` | `'Version'` | Version label prefix |
181
-
182
- ## Hooks
183
-
184
- ### useAboutInfo
185
-
186
- Hook for managing About information with reactive state management.
187
-
188
- ```tsx
189
- import { useAboutInfo } from '@umituz/react-native-settings';
190
-
191
- function MyAboutComponent() {
192
- const {
193
- appInfo,
194
- loading,
195
- error,
196
- initialize,
197
- update,
198
- updateAppInfo,
199
- refresh,
200
- reset,
201
- } = useAboutInfo({
202
- autoInit: true,
203
- initialConfig: {
204
- appName: 'My App',
205
- version: '1.0.0',
206
- },
207
- });
208
-
209
- if (loading) return <Text>Loading...</Text>;
210
- if (error) return <Text>Error: {error}</Text>;
211
-
212
- return (
213
- <View>
214
- <Text>{appInfo?.appName}</Text>
215
- <Text>{appInfo?.version}</Text>
216
- </View>
217
- );
218
- }
219
- ```
220
-
221
- #### Return Value
222
-
223
- | Property | Type | Description |
224
- |----------|------|-------------|
225
- | `appInfo` | `AppInfo \| null` | Current app information |
226
- | `loading` | `boolean` | Loading state |
227
- | `error` | `string \| null` | Error message if any |
228
- | `initialize` | `(config) => Promise<void>` | Initialize with config |
229
- | `update` | `(config) => Promise<void>` | Update with new config |
230
- | `updateAppInfo` | `(updates) => Promise<void>` | Partial update |
231
- | `refresh` | `() => Promise<void>` | Refresh from storage |
232
- | `reset` | `() => void` | Reset state |
233
-
234
- ## Types
235
-
236
- ### AppInfo
237
-
238
- ```typescript
239
- interface AppInfo {
240
- appName: string;
241
- version: string;
242
- buildNumber?: string;
243
- developer?: string;
244
- contactEmail?: string;
245
- websiteUrl?: string;
246
- websiteDisplay?: string;
247
- moreAppsUrl?: string;
248
- }
249
- ```
250
-
251
- ### AboutConfig
252
-
253
- ```typescript
254
- interface AboutConfig {
255
- appName?: string;
256
- version?: string;
257
- buildNumber?: string;
258
- developer?: string;
259
- contactEmail?: string;
260
- websiteUrl?: string;
261
- websiteDisplay?: string;
262
- moreAppsUrl?: string;
263
- actions?: {
264
- onEmailPress?: () => void;
265
- onWebsitePress?: () => void;
266
- onMoreAppsPress?: () => void;
267
- };
268
- texts?: {
269
- versionPrefix?: string;
270
- contact?: string;
271
- developer?: string;
272
- email?: string;
273
- website?: string;
274
- more?: string;
275
- moreApps?: string;
276
- loading?: string;
277
- errorPrefix?: string;
278
- noInfo?: string;
279
- };
280
- }
281
- ```
282
-
283
- ## Examples
284
-
285
- ### Basic Usage
286
-
287
- ```tsx
288
- import React from 'react';
289
- import { View } from 'react-native';
290
- import { AboutScreen } from '@umituz/react-native-settings';
291
-
292
- export default function App() {
293
- return (
294
- <View style={{ flex: 1 }}>
295
- <AboutScreen
296
- config={{
297
- appName: 'My Awesome App',
298
- version: '2.1.0',
299
- buildNumber: '210',
300
- developer: 'My Company',
301
- contactEmail: 'hello@mycompany.com',
302
- websiteUrl: 'https://mycompany.com',
303
- actions: {
304
- onEmailPress: () => {
305
- // Handle email press
306
- Linking.openURL('mailto:hello@mycompany.com');
307
- },
308
- onWebsitePress: () => {
309
- // Handle website press
310
- Linking.openURL('https://mycompany.com');
311
- },
312
- },
313
- }}
314
- />
315
- </View>
316
- );
317
- }
318
- ```
319
-
320
- ### Custom Styling
321
-
322
- ```tsx
323
- import { AboutScreen } from '@umituz/react-native-settings';
324
-
325
- function StyledAboutScreen() {
326
- return (
327
- <AboutScreen
328
- config={{ /* ... */ }}
329
- containerStyle={{ backgroundColor: '#f5f5f5' }}
330
- headerStyle={{ paddingVertical: 24 }}
331
- titleStyle={{ fontSize: 28, fontWeight: 'bold' }}
332
- versionStyle={{ fontSize: 16, color: '#666' }}
333
- />
334
- );
335
- }
336
- ```
337
-
338
- ### Custom Header and Footer
339
-
340
- ```tsx
341
- import { AboutScreen } from '@umituz/react-native-settings';
342
-
343
- function CustomAboutScreen() {
344
- return (
345
- <AboutScreen
346
- config={{ /* ... */ }}
347
- showHeader={false}
348
- headerComponent={
349
- <View style={{ padding: 20, alignItems: 'center' }}>
350
- <Image source={logo} style={{ width: 80, height: 80 }} />
351
- <Text>My Custom Header</Text>
352
- </View>
353
- }
354
- footerComponent={
355
- <View style={{ padding: 20, alignItems: 'center' }}>
356
- <Text>Made with ❤️</Text>
357
- </View>
358
- }
359
- />
360
- );
361
- }
362
- ```
363
-
364
- ### Using the Hook
365
-
366
- ```tsx
367
- import { useAboutInfo } from '@umituz/react-native-settings';
368
-
369
- function AboutManager() {
370
- const { appInfo, updateAppInfo } = useAboutInfo({
371
- autoInit: true,
372
- initialConfig: {
373
- appName: 'My App',
374
- version: '1.0.0',
375
- },
376
- });
377
-
378
- const handleUpdate = async () => {
379
- await updateAppInfo({
380
- version: '1.0.1',
381
- developer: 'New Developer',
382
- });
383
- };
384
-
385
- return (
386
- <View>
387
- <Text>App: {appInfo?.appName}</Text>
388
- <Text>Version: {appInfo?.version}</Text>
389
- <Button title="Update" onPress={handleUpdate} />
390
- </View>
391
- );
392
- }
393
- ```
394
-
395
- ## Architecture
396
-
397
- The About domain follows a clean architecture pattern:
398
-
399
- ```
400
- src/domains/about/
401
- ├── domain/ # Domain entities and interfaces
402
- │ ├── entities/ # AppInfo entity
403
- │ └── repositories/ # Repository interfaces
404
- ├── infrastructure/ # Implementation details
405
- │ └── repositories/ # AboutRepository implementation
406
- ├── presentation/ # UI components
407
- │ ├── screens/ # AboutScreen
408
- │ ├── components/ # AboutContent, AboutHeader, etc.
409
- │ └── hooks/ # useAboutInfo hook
410
- └── utils/ # Utility functions and factories
411
- ```
412
-
413
- ## Best Practices
414
-
415
- 1. **Always provide a config**: The `AboutConfig` is required for proper initialization
416
- 2. **Handle actions**: Implement press handlers for email, website, and other interactive elements
417
- 3. **Provide localized texts**: Use the `texts` property to support multiple languages
418
- 4. **Use the hook for dynamic updates**: The `useAboutInfo` hook is ideal for scenarios where app info changes
419
- 5. **Test with testIDs**: All components support `testID` prop for E2E testing
420
-
421
- ## Testing
422
-
423
- ```tsx
424
- import { render } from '@testing-library/react-native';
425
- import { AboutScreen } from '@umituz/react-native-settings';
426
-
427
- describe('AboutScreen', () => {
428
- it('displays app name and version', () => {
429
- const { getByText } = render(
430
- <AboutScreen
431
- config={{
432
- appName: 'Test App',
433
- version: '1.0.0',
434
- }}
435
- />
436
- );
437
-
438
- expect(getByText('Test App')).toBeTruthy();
439
- expect(getByText('Version 1.0.0')).toBeTruthy();
440
- });
441
- });
442
- ```
3
+ ## Purpose
4
+
5
+ Provides components and utilities for displaying app information, user details, version info, and contact information in your React Native app.
6
+
7
+ ## File Paths
8
+
9
+ **Components:**
10
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/screens/AboutScreen.tsx`
11
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/AboutContent.tsx`
12
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/AboutHeader.tsx`
13
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/AboutSection.tsx`
14
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/AboutSettingItem.tsx`
15
+
16
+ **Hooks:**
17
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/hooks/useAboutInfo.ts`
18
+
19
+ **Domain:**
20
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/domain/entities/AppInfo.ts`
21
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/domain/repositories/IAboutRepository.ts`
22
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/infrastructure/repositories/AboutRepository.ts`
23
+
24
+ **Utils:**
25
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/utils/aboutFactory.ts`
26
+
27
+ **Index:**
28
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/index.ts`
29
+
30
+ ## Strategy
31
+
32
+ 1. **Centralized Information Management**: Use `useAboutInfo` hook to manage app information state consistently across the app
33
+ 2. **Modular Components**: Compose About screens using individual components (AboutHeader, AboutSection, AboutSettingItem) for flexibility
34
+ 3. **Repository Pattern**: Abstract data access through IAboutRepository interface for testability and future extensibility
35
+ 4. **Factory Pattern**: Use `aboutFactory` to create and configure About entities with validation
36
+ 5. **Localization Support**: Configure texts for internationalization through the `texts` property in AboutConfig
37
+
38
+ ## Restrictions (Forbidden)
39
+
40
+ ### DO NOT
41
+ - DO NOT hardcode app information directly in components - always use the repository and hooks
42
+ - ❌ DO NOT bypass the repository pattern when accessing About data
43
+ - ❌ DO NOT modify AppInfo entities directly without using the provided update methods
44
+ - ❌ DO NOT use AboutScreen components without providing proper configuration
45
+
46
+ ### NEVER
47
+ - ❌ NEVER use About components without providing required configuration (config prop)
48
+ - ❌ NEVER expose sensitive information (API keys, secrets) in app information
49
+ - ❌ NEVER skip validation when updating app information through the repository
50
+ - ❌ NEVER use AboutScreen in production without proper error handling
51
+
52
+ ### AVOID
53
+ - ❌ AVOID creating custom About components when existing components can be configured
54
+ - ❌ AVOID mixing app information logic with UI components directly
55
+ - ❌ AVOID storing large data objects (images, binary data) in AppInfo
56
+ - ❌ AVOID using AboutScreen without handling loading and error states
57
+
58
+ ## Rules
59
+
60
+ ### ALWAYS
61
+ - ALWAYS provide a valid AboutConfig when using AboutScreen or AboutContent
62
+ - ALWAYS use the `useAboutInfo` hook for dynamic About information management
63
+ - ALWAYS handle press actions (email, website) with proper URL validation
64
+ - ALWAYS include testID props for E2E testing on interactive components
65
+ - ALWAYS use the repository pattern for data access instead of direct storage access
66
+
67
+ ### MUST
68
+ - MUST provide action handlers for interactive elements (email, website, more apps)
69
+ - ✅ MUST handle loading and error states when using useAboutInfo hook
70
+ - ✅ MUST validate URLs before opening them in Linking API
71
+ - ✅ MUST provide localized texts for multi-language support
72
+ - MUST use TypeScript types from the domain (AppInfo, AboutConfig)
73
+
74
+ ### SHOULD
75
+ - SHOULD provide custom header and footer components for branded experiences
76
+ - ✅ SHOULD implement proper error handling for URL opening failures
77
+ - SHOULD use semantic versioning for version display
78
+ - SHOULD include accessibility labels for all interactive elements
79
+ - SHOULD provide meaningful descriptions for contact information
80
+
81
+ ## AI Agent Guidelines
82
+
83
+ 1. **Component Selection**: Always recommend AboutScreen for full About screens, AboutContent for sections within other screens, and AboutSettingItem for individual settings
84
+ 2. **Data Management**: Always use useAboutInfo hook for state management, never manage state locally
85
+ 3. **Configuration**: Always use AboutConfig interface for type-safe configuration - never use partial configs
86
+ 4. **File Location**: When updating About logic, modify files in `/src/domains/about/` directory following the existing architecture
87
+ 5. **Testing**: Always include testID props and ensure all interactive elements are testable
443
88
 
444
89
  ## Related
445
90