@umituz/react-native-settings 4.20.62 → 4.21.1

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 (69) hide show
  1. package/package.json +6 -61
  2. package/src/domains/gamification/components/AchievementCard.tsx +142 -0
  3. package/src/domains/gamification/components/AchievementItem.tsx +182 -0
  4. package/src/domains/gamification/components/AchievementToast.tsx +122 -0
  5. package/src/domains/gamification/components/GamificationScreen/AchievementsList.tsx +84 -0
  6. package/src/domains/gamification/components/GamificationScreen/Header.tsx +29 -0
  7. package/src/domains/gamification/components/GamificationScreen/StatsGrid.tsx +51 -0
  8. package/src/domains/gamification/components/GamificationScreen/index.tsx +111 -0
  9. package/src/domains/gamification/components/GamificationScreen/styles.ts +43 -0
  10. package/src/domains/gamification/components/GamificationScreen/types.ts +77 -0
  11. package/src/domains/gamification/components/GamificationScreenWrapper.tsx +4 -4
  12. package/src/domains/gamification/components/GamificationSettingsItem.tsx +1 -1
  13. package/src/domains/gamification/components/LevelProgress.tsx +129 -0
  14. package/src/domains/gamification/components/PointsBadge.tsx +60 -0
  15. package/src/domains/gamification/components/StatsCard.tsx +89 -0
  16. package/src/domains/gamification/components/StreakDisplay.tsx +119 -0
  17. package/src/domains/gamification/components/index.ts +13 -0
  18. package/src/domains/gamification/examples/gamification.config.example.ts +1 -1
  19. package/src/domains/gamification/hooks/useGamification.ts +91 -0
  20. package/src/domains/gamification/index.ts +46 -19
  21. package/src/domains/gamification/store/gamificationStore.ts +162 -0
  22. package/src/domains/gamification/types/index.ts +95 -23
  23. package/src/domains/gamification/types/settings.ts +28 -0
  24. package/src/domains/gamification/utils/calculations.ts +85 -0
  25. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -51
  26. package/.github/ISSUE_TEMPLATE/documentation.md +0 -52
  27. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -63
  28. package/.github/PULL_REQUEST_TEMPLATE.md +0 -84
  29. package/AI_AGENT_GUIDELINES.md +0 -367
  30. package/ARCHITECTURE.md +0 -246
  31. package/CHANGELOG.md +0 -67
  32. package/CODE_OF_CONDUCT.md +0 -75
  33. package/CONTRIBUTING.md +0 -107
  34. package/DOCUMENTATION_MIGRATION.md +0 -319
  35. package/DOCUMENTATION_TEMPLATE.md +0 -155
  36. package/SECURITY.md +0 -98
  37. package/SETTINGS_SCREEN_GUIDE.md +0 -185
  38. package/TESTING.md +0 -358
  39. package/src/__tests__/integration.test.tsx +0 -371
  40. package/src/__tests__/performance.test.tsx +0 -369
  41. package/src/__tests__/setup.test.tsx +0 -20
  42. package/src/__tests__/setup.ts +0 -154
  43. package/src/domains/about/__tests__/integration.test.tsx +0 -328
  44. package/src/domains/about/__tests__/types.d.ts +0 -5
  45. package/src/domains/about/domain/entities/__tests__/AppInfo.test.ts +0 -93
  46. package/src/domains/about/infrastructure/repositories/__tests__/AboutRepository.test.ts +0 -153
  47. package/src/domains/about/presentation/components/__tests__/AboutContent.simple.test.tsx +0 -178
  48. package/src/domains/about/presentation/components/__tests__/AboutContent.test.tsx +0 -293
  49. package/src/domains/about/presentation/components/__tests__/AboutHeader.test.tsx +0 -201
  50. package/src/domains/about/presentation/components/__tests__/AboutSettingItem.test.tsx +0 -71
  51. package/src/domains/about/presentation/hooks/__tests__/useAboutInfo.simple.test.tsx +0 -229
  52. package/src/domains/about/presentation/hooks/__tests__/useAboutInfo.test.tsx +0 -240
  53. package/src/domains/about/presentation/screens/__tests__/AboutScreen.simple.test.tsx +0 -199
  54. package/src/domains/about/presentation/screens/__tests__/AboutScreen.test.tsx +0 -366
  55. package/src/domains/about/utils/__tests__/index.test.ts +0 -408
  56. package/src/domains/appearance/__tests__/components/AppearanceScreen.test.tsx +0 -195
  57. package/src/domains/appearance/__tests__/hooks/index.test.tsx +0 -232
  58. package/src/domains/appearance/__tests__/integration/index.test.tsx +0 -207
  59. package/src/domains/appearance/__tests__/services/appearanceService.test.ts +0 -299
  60. package/src/domains/appearance/__tests__/setup.ts +0 -88
  61. package/src/domains/appearance/__tests__/stores/appearanceStore.test.tsx +0 -175
  62. package/src/domains/cloud-sync/presentation/components/__tests__/CloudSyncSetting.test.tsx +0 -78
  63. package/src/domains/legal/__tests__/ContentValidationService.test.ts +0 -195
  64. package/src/domains/legal/__tests__/StyleCacheService.test.ts +0 -110
  65. package/src/domains/legal/__tests__/UrlHandlerService.test.ts +0 -71
  66. package/src/domains/legal/__tests__/setup.ts +0 -82
  67. package/src/presentation/components/__tests__/SettingsErrorBoundary.test.tsx +0 -186
  68. package/src/presentation/screens/__tests__/SettingsScreen.test.tsx +0 -322
  69. package/src/presentation/screens/hooks/__tests__/useFeatureDetection.test.tsx +0 -261
@@ -1,63 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: '[FEATURE] '
5
- labels: enhancement
6
- assignees: ''
7
- ---
8
-
9
- ## Feature Description
10
-
11
- A clear and concise description of the feature you'd like to see added to this package.
12
-
13
- ## Problem Statement
14
-
15
- What problem does this feature solve? What pain point does it address?
16
-
17
- ## Proposed Solution
18
-
19
- Describe your vision for how this feature should work. Include:
20
-
21
- - User interface changes (if any)
22
- - API changes (if any)
23
- - Configuration options
24
- - Default behavior
25
-
26
- ## Alternatives Considered
27
-
28
- Describe alternative solutions or features you've considered.
29
-
30
- ## Additional Context
31
-
32
- Add any other context, mockups, or screenshots about the feature request here.
33
-
34
- ## Use Cases
35
-
36
- Describe specific use cases where this feature would be beneficial:
37
-
38
- 1. First use case
39
- 2. Second use case
40
- 3. More use cases...
41
-
42
- ## Priority
43
-
44
- How important is this feature to you?
45
- - [ ] Critical
46
- - [ ] High
47
- - [ ] Medium
48
- - [ ] Low
49
- - [ ] Nice to have
50
-
51
- ## Implementation
52
-
53
- If you have ideas on how to implement this feature, please describe:
54
-
55
- - Which files would need to be modified
56
- - New components/hooks needed
57
- - Breaking changes
58
- - Migration path from current API
59
-
60
- Would you be willing to contribute this feature?
61
- - [ ] Yes, I can submit a PR
62
- - [ ] Yes, with guidance
63
- - [ ] No, I don't have time
@@ -1,84 +0,0 @@
1
- ## Description
2
-
3
- Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
4
-
5
- Fixes # (issue)
6
-
7
- ## Type of Change
8
-
9
- Please delete options that are not relevant.
10
-
11
- - [ ] Bug fix (non-breaking change which fixes an issue)
12
- - [ ] New feature (non-breaking change which adds functionality)
13
- - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14
- - [ ] Documentation update
15
- - [ ] Refactoring (no functional changes)
16
- - [ ] Other (please describe)
17
-
18
- ## Testing
19
-
20
- Describe the tests you ran and how to reproduce them:
21
-
22
- - [ ] Unit tests pass locally
23
- - [ ] Integration tests pass locally
24
- - [ ] E2E tests pass locally
25
- - [ ] Added new tests
26
- - [ ] No tests needed for this change
27
-
28
- ## Test Coverage
29
-
30
- Please confirm that your changes maintain or improve test coverage:
31
- - [ ] Code coverage remains above 80%
32
- - [ ] Added tests for new functionality
33
- - [ ] Updated tests for refactored code
34
-
35
- ## Documentation
36
-
37
- If your changes affect user-facing documentation:
38
- - [ ] Updated README.md
39
- - [ ] Updated relevant component README
40
- - [ ] Added/updated JSDoc comments
41
- - [ ] Updated AI_AGENT_GUIDELINES.md if needed
42
- - [ ] No documentation updates needed
43
-
44
- ## Checklist
45
-
46
- - [ ] My code follows the style guidelines of this project
47
- - [ ] I have performed a self-review of my own code
48
- - [ ] I have commented my code, particularly in hard-to-understand areas
49
- - [ ] I have made corresponding changes to the documentation
50
- - [ ] My changes generate no new warnings
51
- - [ ] I have added tests that prove my fix is effective or that my feature works
52
- - [ ] New and existing unit tests pass locally with my changes
53
- - [ ] I have run `npm run typecheck` and there are no type errors
54
- - [ ] I have run `npm run lint` and there are no linting errors
55
-
56
- ## Screenshots (if applicable)
57
-
58
- Before:
59
- ![Before](screenshots/before.png)
60
-
61
- After:
62
- ![After](screenshots/after.png)
63
-
64
- ## Breaking Changes
65
-
66
- If this PR introduces breaking changes, please describe them:
67
-
68
- ## Additional Information
69
-
70
- Any additional information, configuration, or data that is important to this PR:
71
-
72
- ## Migration Guide
73
-
74
- If this is a breaking change, please provide a migration guide:
75
-
76
- ### Old Code
77
- \`\`\`typescript
78
- // Old way
79
- \`\`\`
80
-
81
- ### New Code
82
- \`\`\`typescript
83
- // New way
84
- \`\`\`
@@ -1,367 +0,0 @@
1
- # AI Agent Development Guidelines
2
-
3
- Comprehensive guidelines for AI agents when developing with `@umituz/react-native-settings`.
4
-
5
- ## Core Principles
6
-
7
- ### 1. No Code Examples in Documentation
8
- - ❌ **FORBIDDEN**: Including code examples in README files
9
- - ✅ **REQUIRED**: Reference file paths only
10
- - ✅ **REQUIRED**: Describe patterns and strategies
11
- - **REASON**: Code changes frequently, documentation stays valid
12
-
13
- ### 2. File Path References
14
- When describing functionality:
15
- - Always provide exact file path
16
- - Use relative paths from package root
17
- - Include `.tsx` or `.ts` extensions
18
- - Format: `src/path/to/File.tsx`
19
-
20
- ### 3. Strategy-Based Documentation
21
- Each component/module MUST include:
22
- - **Strategy**: How to use it effectively
23
- - **Restrictions**: What NOT to do
24
- - **Rules**: What MUST be followed
25
- - **AI Guidelines**: Specific AI agent instructions
26
-
27
- ## Component Development Rules
28
-
29
- ### When Creating Settings UI
30
-
31
- #### ✅ ALWAYS
32
- 1. **Use Existing Components**
33
- - Check if component exists in `src/presentation/components/`
34
- - Import from `@umituz/react-native-settings`
35
- - Reference implementation file
36
-
37
- 2. **Follow Domain Structure**
38
- - Place feature in appropriate domain
39
- - Use domain's existing patterns
40
- - Reference similar features
41
-
42
- 3. **Type Safety**
43
- - Use TypeScript for all files
44
- - Define proper interfaces
45
- - Export types
46
-
47
- #### ❌ NEVER
48
- 1. **Create Duplicate Components**
49
- - Don't recreate existing components
50
- - Check component library first
51
- - Extend if needed, don't duplicate
52
-
53
- 2. **Bypass Layers**
54
- - Don't skip repository layer
55
- - Don't access storage directly
56
- - Follow DDD layering
57
-
58
- 3. **Hardcode Values**
59
- - Use design system tokens
60
- - Use constants file
61
- - Don't hardcode colors, sizes
62
-
63
- ## File Organization
64
-
65
- ### Domain Structure
66
-
67
- Each domain follows this pattern:
68
- ```
69
- src/domains/{domain-name}/
70
- ├── domain/ # Business entities
71
- ├── application/ # Domain-specific application logic
72
- ├── infrastructure/ # Data persistence
73
- ├── presentation/ # UI components
74
- │ ├── screens/
75
- │ ├── components/
76
- │ └── hooks/
77
- ├── types/ # Domain types
78
- └── utils/ # Domain utilities
79
- ```
80
-
81
- ### Rules
82
- - Place files in correct layer
83
- - Follow existing patterns
84
- - Use proper imports between layers
85
- - Don't create circular dependencies
86
-
87
- ## Component Creation Checklist
88
-
89
- Before creating a new component:
90
-
91
- 1. ✅ **Check Existing Components**
92
- - Search `src/presentation/components/`
93
- - Search domain's `presentation/components/`
94
- - Check if similar component exists
95
-
96
- 2. ✅ **Follow Structure**
97
- - Create in appropriate location
98
- - Use proper naming conventions
99
- - Add TypeScript types
100
-
101
- 3. ✅ **Documentation**
102
- - Create README.md in component directory
103
- - Follow documentation template
104
- - Include Strategy/Restrictions/Rules
105
- - NO CODE EXAMPLES
106
-
107
- 4. ✅ **Testing**
108
- - Add test file alongside component
109
- - Test file: `ComponentName.test.tsx`
110
- - Follow testing patterns
111
-
112
- ## Import Rules
113
-
114
- ### From Package
115
- ```typescript
116
- import { ComponentName } from '@umituz/react-native-settings';
117
- ```
118
-
119
- ### Relative Imports
120
- ```typescript
121
- // Within same domain
122
- import { ComponentName } from '../components/ComponentName';
123
-
124
- // Across domains
125
- import { ComponentName } from '../../domains/{domain}/presentation/components/ComponentName';
126
- ```
127
-
128
- ### Restrictions
129
- - ❌ Don't use deep relative imports (`../../../`)
130
- - ❌ Don't import from implementation files directly
131
- - ✅ Use barrel exports (`index.ts`)
132
-
133
- ## Naming Conventions
134
-
135
- ### Components
136
- - PascalCase: `SettingsItemCard.tsx`
137
- - Descriptive names
138
- - Prefix with feature name if domain-specific
139
-
140
- ### Hooks
141
- - camelCase with `use` prefix: `useSettings.ts`
142
- - Domain hooks: `use{Feature}{Action}.ts`
143
-
144
- ### Utilities
145
- - camelCase: `formatDate.ts`
146
- - Descriptive action names: `normalizeConfig.ts`
147
-
148
- ### Types
149
- - PascalCase for interfaces: `UserSettings.ts`
150
- - Type suffix: `SettingsConfig.types.ts`
151
-
152
- ## Design System Usage
153
-
154
- ### ✅ ALWAYS Use Design System
155
- ```typescript
156
- // Instead of:
157
- color: '#2196F3'
158
- fontSize: 16
159
-
160
- // Use:
161
- color: tokens.colors.primary
162
- fontSize: tokens.typography.fontSize.base
163
- ```
164
-
165
- ### Tokens Reference
166
- See: `src/presentation/design-system/tokens.ts`
167
- - Colors: `tokens.colors.*`
168
- - Spacing: `tokens.spacing.*`
169
- - Typography: `tokens.typography.*`
170
- - Border Radius: `tokens.borderRadius.*`
171
-
172
- ## TypeScript Rules
173
-
174
- ### ✅ MUST
175
- - Type all props
176
- - Type all function parameters
177
- - Type all return values
178
- - Export reusable types
179
- - Use strict mode
180
-
181
- ### Type Definition Location
182
- - Component types: Same file as component
183
- - Shared types: `types/` directory
184
- - Domain types: `src/domains/{domain}/types/`
185
-
186
- ## Error Handling
187
-
188
- ### ✅ ALWAYS
189
- 1. Use try-catch for async operations
190
- 2. Provide meaningful error messages
191
- 3. Log errors appropriately
192
- 4. Handle user-friendly errors
193
-
194
- ### Pattern
195
- ```typescript
196
- // Check implementation files for patterns
197
- // Repository: src/infrastructure/repositories/SettingsRepository.ts
198
- // Service: src/infrastructure/services/SettingsService.ts
199
- ```
200
-
201
- ## Performance Rules
202
-
203
- ### ✅ ALWAYS
204
- 1. Use React.memo for expensive components
205
- 2. Use useCallback for handlers
206
- 3. Use useMemo for computed values
207
- 4. Avoid unnecessary re-renders
208
-
209
- ### ❌ NEVER
210
- 1. Define functions in render
211
- 2. Create objects in render
212
- 3. Skip optimization without reason
213
- 4. Ignore performance warnings
214
-
215
- ## Accessibility
216
-
217
- ### ✅ MUST
218
- 1. Add accessibilityLabel to interactive elements
219
- 2. Provide accessibilityHint for complex interactions
220
- 3. Support screen readers
221
- 4. Maintain proper touch target sizes (44x44 min)
222
-
223
- ## Testing Guidelines
224
-
225
- ### Test File Location
226
- - Next to component: `ComponentName.test.tsx`
227
- - In `__tests__` directory: `__tests__/ComponentName.test.tsx`
228
-
229
- ### What to Test
230
- - Component rendering
231
- - User interactions
232
- - Props changes
233
- - Error states
234
- - Accessibility
235
-
236
- ### Pattern Reference
237
- Check existing test files:
238
- - `src/presentation/components/__tests__/SettingsItemCard.test.tsx`
239
- - `src/domains/about/presentation/components/__tests__/AboutContent.test.tsx`
240
-
241
- ## Common Patterns
242
-
243
- ### Adding a New Settings Item
244
-
245
- 1. **Check Existing**: Look at `SettingsItemCard` usage
246
- 2. **Follow Pattern**: Use `SettingsItemCard` component
247
- 3. **Reference File**: `src/presentation/components/SettingsItemCard/SettingsItemCard.tsx`
248
- 4. **No Custom Code**: Don't create custom item cards
249
-
250
- ### Adding a New Domain
251
-
252
- 1. **Follow Structure**: Copy existing domain structure
253
- 2. **Reference**: Similar domain for patterns
254
- 3. **Layers**: domain/, application/, infrastructure/, presentation/
255
- 4. **Documentation**: Create domain README with strategy/restrictions/rules
256
-
257
- ### Adding Navigation
258
-
259
- 1. **Reference**: `src/presentation/navigation/`
260
- 2. **Use Wrappers**: Existing screen wrappers
261
- 3. **Follow Patterns**: See navigation utilities
262
- 4. **No Inline**: Don't inline navigation logic
263
-
264
- ## File Reference Patterns
265
-
266
- When agent needs to implement something:
267
-
268
- 1. **Find Similar Implementation**
269
- ```
270
- Search: Use Task tool with Explore agent
271
- Pattern: Look for similar feature in existing code
272
- Reference: Check READMEs for file paths
273
- ```
274
-
275
- 2. **Follow Existing Patterns**
276
- ```
277
- Don't: Create from scratch
278
- Do: Reference and adapt existing code
279
- Verify: Check implementation file directly
280
- ```
281
-
282
- 3. **Check Documentation First**
283
- ```
284
- 1. Read component README
285
- 2. Check Strategy section
286
- 3. Follow Rules section
287
- 4. Reference file path
288
- ```
289
-
290
- ## Verification Steps
291
-
292
- ### Before Completing Task
293
-
294
- 1. ✅ **Checked Documentation**
295
- - Read relevant README files
296
- - Understood strategy and restrictions
297
- - Know the file paths
298
-
299
- 2. ✅ **Referenced Implementation**
300
- - Looked at similar components
301
- - Followed existing patterns
302
- - Used same imports
303
-
304
- 3. ✅ **Followed Rules**
305
- - No code examples in docs
306
- - All files properly typed
307
- - Design system tokens used
308
- - Error handling included
309
-
310
- 4. ✅ **Testing**
311
- - Added tests if new component
312
- - Verified existing tests pass
313
- - Tested on both platforms if needed
314
-
315
- ## Quick Reference
316
-
317
- ### Common File Paths
318
-
319
- ```
320
- Components:
321
- src/presentation/components/SettingsItemCard/
322
- src/presentation/screens/components/SettingsContent/
323
-
324
- Domains:
325
- src/domains/about/
326
- src/domains/appearance/
327
- src/domains/legal/
328
- (etc.)
329
-
330
- Configuration:
331
- src/presentation/screens/types/SettingsConfig.ts
332
- src/presentation/screens/utils/normalizeConfig.ts
333
-
334
- Navigation:
335
- src/presentation/navigation/components/
336
- src/presentation/navigation/hooks/
337
- src/presentation/navigation/utils/
338
- ```
339
-
340
- ### Key Import Patterns
341
-
342
- ```typescript
343
- // From package
344
- import { X } from '@umituz/react-native-settings';
345
-
346
- // Domain components
347
- import { X } from '../../domains/{domain}/presentation/components/X';
348
-
349
- // Utilities
350
- import { util } from '../../path/to/util';
351
- ```
352
-
353
- ## Summary
354
-
355
- ### Agent Approach
356
- 1. **Read Documentation First** - Check READMEs
357
- 2. **Reference Implementation** - Look at file paths
358
- 3. **Follow Patterns** - Don't create from scratch
359
- 4. **No Code Examples** - Keep docs code-free
360
- 5. **Strategy Over Syntax** - Focus on approach
361
-
362
- ### Success Criteria
363
- - ✅ Uses existing components
364
- - ✅ Follows domain structure
365
- - ✅ Includes proper documentation
366
- - ✅ No code examples in docs
367
- - ✅ File paths referenced correctly