@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,394 +1,97 @@
1
1
  # Disclaimer Components
2
2
 
3
- Components for displaying legal disclaimers, warnings, and important information to users.
4
-
5
- ## Components
6
-
7
- ### DisclaimerCard
8
-
9
- Compact card component for displaying disclaimer summary with expand/collapse functionality.
10
-
11
- ```tsx
12
- import { DisclaimerCard } from '@umituz/react-native-settings';
13
-
14
- function SettingsScreen() {
15
- return (
16
- <DisclaimerCard
17
- title="Important Notice"
18
- message="Please read our terms and conditions"
19
- icon="warning-outline"
20
- onPress={() => navigation.navigate('Disclaimer')}
21
- />
22
- );
23
- }
24
- ```
25
-
26
- #### Props
27
-
28
- | Prop | Type | Default | Description |
29
- |------|------|---------|-------------|
30
- | `title` | `string` | **Required** | Card title |
31
- | `message` | `string` | **Required** | Disclaimer message |
32
- | `icon` | `IconName` | `'warning-outline'` | Warning icon |
33
- | `iconColor` | `string` | `'#FF9800'` | Icon color |
34
- | `onPress` | `() => void` | **Required** | Press handler |
35
- | `style` | `ViewStyle` | `undefined` | Custom container style |
36
-
37
- #### Example
38
-
39
- ```tsx
40
- <DisclaimerCard
41
- title="Beta Version"
42
- message="This is a beta version. Use at your own risk."
43
- icon="alert-circle-outline"
44
- iconColor="#F44336"
45
- onPress={() => showDisclaimer()}
46
- />
47
- ```
48
-
49
- ### DisclaimerModal
50
-
51
- Full-screen modal component for displaying comprehensive disclaimer content.
52
-
53
- ```tsx
54
- import { DisclaimerModal } from '@umituz/react-native-settings';
55
-
56
- function DisclaimerModalExample() {
57
- const [visible, setVisible] = useState(false);
58
-
59
- return (
60
- <DisclaimerModal
61
- visible={visible}
62
- title="Disclaimer"
63
- message="This is the full disclaimer text..."
64
- onClose={() => setVisible(false)}
65
- onAccept={() => {
66
- acceptDisclaimer();
67
- setVisible(false);
68
- }}
69
- />
70
- );
71
- }
72
- ```
73
-
74
- #### Props
75
-
76
- | Prop | Type | Default | Description |
77
- |------|------|---------|-------------|
78
- | `visible` | `boolean` | **Required** | Modal visibility |
79
- | `title` | `string` | **Required** | Modal title |
80
- | `message` | `string` | **Required** | Disclaimer message |
81
- | `onClose` | `() => void` | **Required** | Close handler |
82
- | `onAccept` | `() => void` | **Required** | Accept handler |
83
- | `acceptText` | `string` | `'I Accept'` | Accept button text |
84
- | `closeText` | `string` | `'Close'` | Close button text |
85
- | `scrollEnabled` | `boolean` | `true` | Enable content scroll |
86
-
87
- #### Example
88
-
89
- ```tsx
90
- <DisclaimerModal
91
- visible={showDisclaimer}
92
- title="Terms of Service"
93
- message="By using this app, you agree to our terms..."
94
- onClose={() => setShowDisclaimer(false)}
95
- onAccept={() => {
96
- saveAcceptance();
97
- setShowDisclaimer(false);
98
- }}
99
- acceptText="I Agree"
100
- closeText="Decline"
101
- />
102
- ```
103
-
104
- ### DisclaimerSetting
105
-
106
- Combined card + modal component for integrated disclaimer display.
107
-
108
- ```tsx
109
- import { DisclaimerSetting } from '@umituz/react-native-settings';
110
-
111
- function DisclaimerSettingExample() {
112
- return (
113
- <DisclaimerSetting
114
- title="Legal Disclaimer"
115
- message="Important legal information"
116
- fullText="Full disclaimer text here..."
117
- onAccept={() => saveAcceptance()}
118
- />
119
- );
120
- }
121
- ```
122
-
123
- #### Props
124
-
125
- | Prop | Type | Default | Description |
126
- |------|------|---------|-------------|
127
- | `title` | `string` | **Required** | Disclaimer title |
128
- | `message` | `string` | **Required** | Short message |
129
- | `fullText` | `string` | **Required** | Full disclaimer text |
130
- | `onAccept` | `() => void` | **Required** | Accept handler |
131
- | `icon` | `IconName` | `'warning-outline'` | Icon name |
132
- | `showOnce` | `boolean` | `false` | Show only once |
133
- | `storageKey` | `string` | `'disclaimer'` | Storage key |
134
-
135
- #### Example
136
-
137
- ```tsx
138
- <DisclaimerSetting
139
- title="Privacy Notice"
140
- message="We care about your privacy"
141
- fullText="This is the full privacy policy text..."
142
- onAccept={() => {
143
- AsyncStorage.setItem('privacy-accepted', 'true');
144
- }}
145
- showOnce={true}
146
- storageKey="privacy-disclaimer-2024"
147
- />
148
- ```
149
-
150
- ### DisclaimerScreen
151
-
152
- Dedicated screen component for comprehensive disclaimers.
153
-
154
- ```tsx
155
- import { DisclaimerScreen } from '@umituz/react-native-settings';
156
-
157
- function DisclaimerStack() {
158
- return (
159
- <Stack.Screen
160
- name="Disclaimer"
161
- component={DisclaimerScreen}
162
- options={{ title: 'Disclaimer' }}
163
- initialParams={{
164
- title: 'Legal Disclaimer',
165
- message: 'Full disclaimer content...',
166
- }}
167
- />
168
- );
169
- }
170
- ```
171
-
172
- #### Props
173
-
174
- | Prop | Type | Default | Description |
175
- |------|------|---------|-------------|
176
- | `route` | `RouteProp` | **Required** | Route with params |
177
- | `navigation` | `NavigationProp` | **Required** | Navigation object |
178
-
179
- #### Route Params
180
-
181
- ```typescript
182
- interface DisclaimerScreenParams {
183
- title: string;
184
- message: string;
185
- showAccept?: boolean;
186
- onAccept?: () => void;
187
- }
188
- ```
189
-
190
- ## Examples
191
-
192
- ### One-Time Disclaimer
193
-
194
- ```tsx
195
- function OneTimeDisclaimer() {
196
- const [hasAccepted, setHasAccepted] = useState(false);
197
-
198
- useEffect(() => {
199
- AsyncStorage.getItem('disclaimer-accepted').then(value => {
200
- setHasAccepted(!!value);
201
- });
202
- }, []);
203
-
204
- const handleAccept = async () => {
205
- await AsyncStorage.setItem('disclaimer-accepted', new Date().toISOString());
206
- setHasAccepted(true);
207
- };
208
-
209
- if (hasAccepted) {
210
- return null;
211
- }
212
-
213
- return (
214
- <DisclaimerModal
215
- visible={!hasAccepted}
216
- title="Welcome!"
217
- message="Please read and accept our disclaimer"
218
- fullText="Full disclaimer text..."
219
- onClose={() => {}}
220
- onAccept={handleAccept}
221
- acceptText="I Accept"
222
- />
223
- );
224
- }
225
- ```
226
-
227
- ### Versioned Disclaimer
228
-
229
- ```tsx
230
- function VersionedDisclaimer() {
231
- const DISCLAIMER_VERSION = '2.0';
232
-
233
- const checkDisclaimer = async () => {
234
- const acceptedVersion = await AsyncStorage.getItem('disclaimer-version');
235
- return acceptedVersion === DISCLAIMER_VERSION;
236
- };
237
-
238
- const acceptDisclaimer = async () => {
239
- await AsyncStorage.setItem('disclaimer-version', DISCLAIMER_VERSION);
240
- };
241
-
242
- return (
243
- <DisclaimerSetting
244
- title="Updated Disclaimer"
245
- message="Our disclaimer has been updated"
246
- fullText="New disclaimer content..."
247
- onAccept={acceptDisclaimer}
248
- />
249
- );
250
- }
251
- ```
252
-
253
- ### Conditional Disclaimer
254
-
255
- ```tsx
256
- function ConditionalDisclaimer({ featureEnabled }) {
257
- if (!featureEnabled) {
258
- return (
259
- <DisclaimerCard
260
- title="Feature Unavailable"
261
- message="This feature is not available in your region"
262
- icon="lock-closed-outline"
263
- onPress={() => {}}
264
- />
265
- );
266
- }
267
-
268
- return <FeatureContent />;
269
- }
270
- ```
271
-
272
- ### Multiple Disclaimers
273
-
274
- ```tsx
275
- function DisclaimerStack() {
276
- return (
277
- <View>
278
- <DisclaimerSetting
279
- title="Privacy Policy"
280
- message="We value your privacy"
281
- fullText="Privacy policy..."
282
- onAccept={() => {}}
283
- storageKey="privacy"
284
- />
285
-
286
- <DisclaimerSetting
287
- title="Terms of Service"
288
- message="Please read our terms"
289
- fullText="Terms of service..."
290
- onAccept={() => {}}
291
- storageKey="terms"
292
- />
293
-
294
- <DisclaimerSetting
295
- title="Beta Warning"
296
- message="This is beta software"
297
- fullText="Beta warning..."
298
- onAccept={() => {}}
299
- storageKey="beta"
300
- />
301
- </View>
302
- );
303
- }
304
- ```
305
-
306
- ## Internationalization
307
-
308
- ### Translation Keys
309
-
310
- ```typescript
311
- // Translation keys used
312
- disclaimer.title = 'Disclaimer';
313
- disclaimer.message = 'Important legal information';
314
- disclaimer.accept = 'I Accept';
315
- disclaimer.decline = 'Decline';
316
- disclaimer.close = 'Close';
317
- ```
318
-
319
- ### Usage with i18n
320
-
321
- ```tsx
322
- import { useTranslation } from 'react-i18next';
323
-
324
- function LocalizedDisclaimer() {
325
- const { t } = useTranslation();
326
-
327
- return (
328
- <DisclaimerModal
329
- visible={visible}
330
- title={t('disclaimer.title')}
331
- message={t('disclaimer.message')}
332
- fullText={t('disclaimer.fullText')}
333
- onClose={() => setVisible(false)}
334
- onAccept={() => accept()}
335
- acceptText={t('disclaimer.accept')}
336
- closeText={t('disclaimer.decline')}
337
- />
338
- );
339
- }
340
- ```
341
-
342
- ## Styling
343
-
344
- ### Custom Card Styles
345
-
346
- ```tsx
347
- <DisclaimerCard
348
- title="Custom Warning"
349
- message="This is a custom styled disclaimer"
350
- style={{
351
- backgroundColor: '#FFF3E0',
352
- borderLeftWidth: 4,
353
- borderLeftColor: '#FF9800',
354
- padding: 16,
355
- }}
356
- />
357
- ```
358
-
359
- ### Custom Modal Styles
360
-
361
- ```tsx
362
- <DisclaimerModal
363
- visible={visible}
364
- title="Disclaimer"
365
- message="Content..."
366
- containerStyle={{
367
- backgroundColor: 'rgba(0, 0, 0, 0.8)',
368
- }}
369
- contentStyle={{
370
- backgroundColor: 'white',
371
- borderRadius: 16,
372
- padding: 24,
373
- }}
374
- />
375
- ```
376
-
377
- ## Best Practices
378
-
379
- 1. **Clarity**: Use clear, concise language
380
- 2. **Visibility**: Make disclaimers prominent
381
- 3. **Acceptance**: Require explicit acceptance
382
- 4. **Storage**: Store acceptance properly
383
- 5. **Versions**: Version your disclaimers
384
- 6. **Updates**: Handle disclaimer updates
385
- 7. **Legal**: Ensure legal compliance
386
-
387
- ## Related
388
-
389
- - **Disclaimer Domain**: Disclaimer domain documentation
390
- - **Legal Domain**: Legal documents and policies
391
-
392
- ## License
393
-
394
- MIT
3
+ ## Purpose
4
+
5
+ Components for displaying legal disclaimers, warnings, and important information to users. Provides flexible options for showing disclaimers as cards, modals, or integrated settings with acceptance tracking.
6
+
7
+ ## File Paths
8
+
9
+ - **DisclaimerCard**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerCard.tsx`
10
+ - **DisclaimerModal**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerModal.tsx`
11
+ - **DisclaimerSetting**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerSetting.tsx`
12
+ - **DisclaimerScreen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/screens/DisclaimerScreen.tsx`
13
+
14
+ ## Strategy
15
+
16
+ 1. **Progressive Disclosure**: Uses compact cards for summary information with expand/collapse functionality, showing full details only when users explicitly request them via modals or dedicated screens.
17
+
18
+ 2. **Acceptance Tracking**: Implements storage-based tracking of user acceptance, allowing one-time or versioned disclaimers that don't repeatedly show to users who have already accepted.
19
+
20
+ 3. **Flexible Display Options**: Provides multiple component variants (card, modal, setting, screen) to accommodate different UX requirements and legal compliance needs.
21
+
22
+ 4. **Legal Compliance**: Designed to support various legal scenarios including terms of service, privacy policies, beta warnings, and regional restrictions with proper acceptance handling.
23
+
24
+ 5. **Internationalization Ready**: Supports translation keys and localized content to display disclaimers in user's preferred language, essential for global apps.
25
+
26
+ ## Restrictions
27
+
28
+ ### DO NOT
29
+
30
+ - Hide critical legal information behind multiple taps
31
+ - Use confusing or ambiguous language
32
+ - Bypass acceptance tracking for required disclaimers
33
+ - Display disclaimers that are hard to read or dismiss
34
+ - Mix different disclaimer types inappropriately
35
+
36
+ ### ❌ NEVER
37
+
38
+ - Allow users to proceed without accepting required disclaimers
39
+ - Store acceptance without reliable persistence mechanism
40
+ - Show outdated or superseded disclaimer versions
41
+ - Use dark patterns to trick users into acceptance
42
+ - Display illegal or unenforceable disclaimer content
43
+
44
+ ### ❌ AVOID
45
+
46
+ - Overly long disclaimer text (break into sections)
47
+ - Technical jargon that average users don't understand
48
+ - Aggressive or alarming icon choices
49
+ - Blocking app usage for non-critical disclaimers
50
+ - Showing disclaimers too frequently
51
+
52
+ ## Rules
53
+
54
+ ### ALWAYS
55
+
56
+ - Use clear, concise language in disclaimers
57
+ - Require explicit acceptance for legal disclaimers
58
+ - Store acceptance reliably using AsyncStorage
59
+ - Provide easy access to full disclaimer text
60
+ - Allow users to review disclaimers anytime
61
+
62
+ ### ✅ MUST
63
+
64
+ - Show disclaimers before relevant features are used
65
+ - Include accept/decline options for modal disclaimers
66
+ - Version disclaimers to track updates
67
+ - Provide legal contact information
68
+ - Comply with regional legal requirements
69
+
70
+ ### ✅ SHOULD
71
+
72
+ - Use showOnce for one-time acknowledgments
73
+ - Implement version checking for updated disclaimers
74
+ - Group related disclaimers together
75
+ - Use appropriate warning levels (info, warning, error)
76
+ - Provide translations for all user-facing text
77
+ - Test disclaimer flows thoroughly
78
+
79
+ ## AI Agent Guidelines
80
+
81
+ 1. **Component Selection**: Use DisclaimerCard for non-critical notices and summaries. Use DisclaimerModal for required legal acceptance (terms, privacy). Use DisclaimerSetting for optional features or beta warnings. Use DisclaimerScreen for comprehensive legal documents.
82
+
83
+ 2. **Acceptance Strategy**: For required legal disclaimers (terms, privacy), block app or feature usage until accepted. Use version checking to show updated disclaimers only when content changes. For non-critical notices, use showOnce to avoid annoying users.
84
+
85
+ 3. **Storage Best Practices**: Use AsyncStorage with unique keys for each disclaimer. Include version numbers in storage keys (e.g., "privacy-2024-01"). Store acceptance timestamp to track when users agreed. Clear storage when app is uninstalled.
86
+
87
+ 4. **Content Organization**: Break long legal documents into sections with clear headings. Use formatting (bold, lists) to improve readability. Consider providing a summary with link to full text. Ensure font sizes are readable (minimum 14px).
88
+
89
+ 5. **User Experience**: Make acceptance actions clear (use "I Agree" / "I Accept" rather than "OK"). Provide a way to decline with clear consequences. Don't block the entire app for minor disclaimers - allow access to other features. Consider showing disclaimers at appropriate times (onboarding, before specific features).
90
+
91
+ ## Reference
92
+
93
+ - **Card Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerCard.tsx`
94
+ - **Modal Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerModal.tsx`
95
+ - **Setting Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerSetting.tsx`
96
+ - **Screen Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/screens/DisclaimerScreen.tsx`
97
+ - **Disclaimer Components**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/`