@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
@@ -0,0 +1,246 @@
1
+ # Architecture Overview
2
+
3
+ Comprehensive architecture documentation for the `@umituz/react-native-settings` package following Domain-Driven Design (DDD) principles.
4
+
5
+ ## Purpose
6
+
7
+ This document defines the architectural principles, structural organization, and design patterns governing the `@umituz/react-native-settings` package. It serves as the authoritative reference for understanding the system's layered architecture, domain organization, and interaction patterns between components.
8
+
9
+ ## File Paths
10
+
11
+ **Base Directory**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/`
12
+
13
+ **Key Structure**:
14
+ - `/src/domains/` - Domain-specific modules
15
+ - `/src/application/` - Application layer interfaces
16
+ - `/src/infrastructure/` - Infrastructure implementations
17
+ - `/src/presentation/` - UI components and screens
18
+
19
+ ## Architecture Layers
20
+
21
+ ```
22
+ ┌─────────────────────────────────────────┐
23
+ │ Presentation Layer │
24
+ │ (UI Components, Screens, Hooks) │
25
+ └─────────────────────────────────────────┘
26
+
27
+ ┌─────────────────────────────────────────┐
28
+ │ Application Layer │
29
+ │ (Business Logic, Interfaces) │
30
+ └─────────────────────────────────────────┘
31
+
32
+ ┌─────────────────────────────────────────┐
33
+ │ Infrastructure Layer │
34
+ │ (Data Persistence, Services) │
35
+ └─────────────────────────────────────────┘
36
+
37
+ ┌─────────────────────────────────────────┐
38
+ │ Domain Layer │
39
+ │ (Business Entities, Rules) │
40
+ └─────────────────────────────────────────┘
41
+ ```
42
+
43
+ ### Layer Responsibilities
44
+
45
+ **Presentation Layer**: UI rendering and user interaction handling
46
+ **Application Layer**: Business logic orchestration and interface definitions
47
+ **Infrastructure Layer**: Data persistence and external service implementations
48
+ **Domain Layer**: Business entities, rules, and domain-specific logic
49
+
50
+ ## Directory Structure
51
+
52
+ ```
53
+ src/
54
+ ├── domains/ # Business domains
55
+ │ ├── about/
56
+ │ ├── appearance/
57
+ │ ├── legal/
58
+ │ ├── disclaimer/
59
+ │ ├── feedback/
60
+ │ ├── faqs/
61
+ │ ├── rating/
62
+ │ ├── video-tutorials/
63
+ │ ├── cloud-sync/
64
+ │ └── dev/
65
+ ├── application/ # Application layer
66
+ │ └── ports/ # Layer interfaces
67
+ ├── infrastructure/ # Infrastructure layer
68
+ │ ├── repositories/ # Data repositories
69
+ │ └── services/ # Business services
70
+ └── presentation/ # Presentation layer
71
+ ├── components/ # Shared components
72
+ ├── screens/ # Screens
73
+ ├── hooks/ # Presentation hooks
74
+ └── navigation/ # Navigation
75
+ ```
76
+
77
+ ## Domain Organization
78
+
79
+ Each domain follows a consistent self-contained structure:
80
+
81
+ ```
82
+ domain/
83
+ ├── domain/ # Business entities
84
+ ├── application/ # Domain-specific application logic
85
+ ├── infrastructure/ # Domain-specific infrastructure
86
+ ├── presentation/ # Domain-specific UI
87
+ ├── types/ # Domain types
88
+ └── utils/ # Domain utilities
89
+ ```
90
+
91
+ ### Domain Examples
92
+
93
+ **About Domain**: Application information, version details, developer contact
94
+ **Appearance Domain**: Theme settings, language preferences, display options
95
+ **Legal Domain**: Terms of service, privacy policy, legal notices
96
+ **Disclaimer Domain**: Usage disclaimers, liability statements
97
+ **Feedback Domain**: User feedback collection, issue reporting
98
+ **FAQs Domain**: Frequently asked questions and answers
99
+ **Rating Domain**: App store ratings, review prompts
100
+ **Video Tutorials Domain**: Tutorial videos, help content
101
+ **Cloud Sync Domain**: Data synchronization, backup/restore
102
+ **Dev Domain**: Development tools, debugging features
103
+
104
+ ## Data Flow Patterns
105
+
106
+ ### Reading Settings
107
+
108
+ ```
109
+ User → UI Component → Hook → Query → Service → Repository → Storage
110
+ ```
111
+
112
+ ### Updating Settings
113
+
114
+ ```
115
+ User → UI → Mutation Hook → Service → Repository → Storage
116
+ ```
117
+
118
+ ## Design Patterns
119
+
120
+ ### Repository Pattern
121
+ Separates data access logic from business logic through interface-based abstractions
122
+
123
+ ### Dependency Injection
124
+ Inject dependencies through constructors for testability and flexibility
125
+
126
+ ### Factory Pattern
127
+ Create objects with factory functions for consistent object creation
128
+
129
+ ### Observer Pattern
130
+ React hooks and TanStack Query use observer pattern for reactive state management
131
+
132
+ ## Strategy
133
+
134
+ 1. **Domain-Driven Organization**: Structure the codebase around business domains rather than technical layers, ensuring each domain is self-contained with its own entities, logic, and presentation
135
+
136
+ 2. **Layered Architecture**: Maintain clear separation between presentation, application, infrastructure, and domain layers with unidirectional dependencies flowing from outer to inner layers
137
+
138
+ 3. **Interface-Based Design**: Define clear interfaces between layers and components to enable loose coupling, testability, and independent evolution of components
139
+
140
+ 4. **Dependency Inversion**: Depend on abstractions rather than concrete implementations, allowing for easy substitution of implementations (e.g., different storage backends)
141
+
142
+ 5. **Single Responsibility Principle**: Each component, service, and module should have one reason to change, ensuring focused, maintainable code
143
+
144
+ ## Restrictions
145
+
146
+ ### ❌ DO NOT
147
+
148
+ - Skip architectural layers when communicating between components (e.g., Presentation must not directly access Storage)
149
+ - Create circular dependencies between layers or domains
150
+ - Mix concerns within a single layer (e.g., business logic in presentation components)
151
+ - Access external services directly from domain or presentation layers
152
+ - Duplicate business logic across multiple domains or components
153
+
154
+ ### ❌ NEVER
155
+
156
+ - Allow presentation components to directly access infrastructure implementations
157
+ - Create dependencies from inner layers (domain/infrastructure) to outer layers (presentation)
158
+ - Implement business rules in UI components or hooks
159
+ - Share mutable state between different domains without proper encapsulation
160
+ - Bypass repository interfaces when accessing data
161
+
162
+ ### ❌ AVOID
163
+
164
+ - Creating tightly coupled dependencies between different domains
165
+ - Implementing complex business logic in presentation layer hooks
166
+ - Using global state or singletons for sharing data between layers
167
+ - Making infrastructure details (e.g., storage implementation) visible to other layers
168
+ - Creating overly complex abstractions that don't serve a clear purpose
169
+
170
+ ## Rules
171
+
172
+ ### ✅ ALWAYS
173
+
174
+ - Use interfaces to define contracts between layers and components
175
+ - Follow dependency injection patterns for passing dependencies
176
+ - Implement proper error handling at each layer with consistent error types
177
+ - Maintain type safety with TypeScript throughout the architecture
178
+ - Write tests that verify behavior at each architectural layer
179
+
180
+ ### ✅ MUST
181
+
182
+ - Ensure all data access goes through repository interfaces
183
+ - Keep domain entities and business rules independent of infrastructure
184
+ - Implement proper separation of concerns in all components
185
+ - Use async/await for all asynchronous operations
186
+ - Handle edge cases and errors gracefully at each layer
187
+
188
+ ### ✅ SHOULD
189
+
190
+ - Prefer composition over inheritance when sharing behavior
191
+ - Keep interfaces focused and cohesive (small, related sets of methods)
192
+ - Use factory functions for creating complex objects with dependencies
193
+ - Implement proper logging at each layer for debugging and monitoring
194
+ - Maintain consistency in naming conventions across all layers
195
+
196
+ ## AI Agent Guidelines
197
+
198
+ ### Architecture Modifications
199
+
200
+ When modifying the architecture:
201
+
202
+ 1. **Layer Adherence**: Always respect the layered architecture and maintain unidirectional dependencies from outer to inner layers
203
+ 2. **Domain Boundaries**: Keep domains self-contained and minimize inter-domain dependencies
204
+ 3. **Interface Stability**: When changing interfaces, maintain backward compatibility or provide migration paths
205
+ 4. **Incremental Changes**: Make architectural changes incrementally, ensuring tests pass at each step
206
+
207
+ ### Adding New Features
208
+
209
+ When adding new features:
210
+
211
+ 1. **Domain Identification**: Determine which domain the feature belongs to, or create a new domain if appropriate
212
+ 2. **Layer Placement**: Place each piece of functionality in the appropriate layer following the architecture patterns
213
+ 3. **Interface Design**: Design clear interfaces before implementing functionality
214
+ 4. **Dependency Management**: Use dependency injection to pass dependencies and enable testing
215
+
216
+ ### Refactoring Guidelines
217
+
218
+ When refactoring existing code:
219
+
220
+ 1. **Maintain Contracts**: Keep existing interfaces stable; internal refactoring should not break external contracts
221
+ 2. **Test Coverage**: Ensure comprehensive test coverage before and after refactoring
222
+ 3. **Gradual Migration**: Refactor incrementally, maintaining functionality at each step
223
+ 4. **Documentation Updates**: Update architecture documentation to reflect significant structural changes
224
+
225
+ ### Code Review Checklist
226
+
227
+ Review should verify:
228
+
229
+ - Layer separation is maintained
230
+ - Dependencies flow in correct direction (outer → inner)
231
+ - Interfaces are well-defined and cohesive
232
+ - Domain logic is properly encapsulated
233
+ - Error handling is consistent across layers
234
+ - Tests cover all architectural layers
235
+ - No circular dependencies exist
236
+ - Type safety is maintained throughout
237
+
238
+ ## Related Documentation
239
+
240
+ - **TESTING.md**: Comprehensive testing strategies for each architectural layer
241
+ - **Domain READMEs**: Individual domain-specific documentation
242
+ - **Component Documentation**: UI component usage and patterns
243
+
244
+ ## License
245
+
246
+ MIT
package/CHANGELOG.md ADDED
@@ -0,0 +1,67 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.20.58] - 2025-01-08
9
+
10
+ ### Added
11
+ - Complete documentation migration to new format
12
+ - AI Agent Guidelines for all components
13
+ - Strategy-based documentation without code examples
14
+ - File path references in all documentation
15
+ - CONTRIBUTING.md guide
16
+ - LICENSE file
17
+
18
+ ### Changed
19
+ - All README files now use Purpose/Strategy/Restrictions/Rules format
20
+ - ARCHITECTURE.md updated to new documentation style
21
+ - TESTING.md updated to new documentation style
22
+ - Removed all code examples from documentation
23
+ - Added AI-friendly guidelines throughout
24
+
25
+ ### Fixed
26
+ - Documentation consistency across all files
27
+ - Missing file path references
28
+ - Incomplete AI guidelines
29
+
30
+ ## [4.20.57] - Previous Releases
31
+
32
+ ### Features
33
+ - Settings screen with modular sections
34
+ - Theme management (light, dark, auto)
35
+ - Language selection
36
+ - Notification preferences
37
+ - About screen with app info
38
+ - Legal documents (privacy, terms)
39
+ - Disclaimer system
40
+ - Feedback collection
41
+ - FAQ management
42
+ - Rating prompts
43
+ - Video tutorials
44
+ - Cloud sync support
45
+ - Development utilities
46
+
47
+ ### Architecture
48
+ - Domain-Driven Design (DDD)
49
+ - Four-layer architecture
50
+ - Repository pattern
51
+ - Service layer
52
+ - TanStack Query integration
53
+ - Type-safe implementation
54
+
55
+ ## Documentation Format
56
+
57
+ From version 4.20.58 onwards, all documentation follows:
58
+ - No code examples
59
+ - Strategy-based approach
60
+ - File path references
61
+ - Clear restrictions (❌ DO NOT, ❌ NEVER, ❌ AVOID)
62
+ - Mandatory rules (✅ ALWAYS, ✅ MUST, ✅ SHOULD)
63
+ - AI Agent Guidelines
64
+
65
+ ## License
66
+
67
+ MIT License - see LICENSE file for details
@@ -0,0 +1,75 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ ### Positive Behavior
18
+
19
+ - Using welcoming and inclusive language
20
+ - Being respectful of differing viewpoints and experiences
21
+ - Gracefully accepting constructive criticism
22
+ - Focusing on what is best for the community
23
+ - Showing empathy towards other community members
24
+
25
+ ### Unacceptable Behavior
26
+
27
+ - The use of sexualized language or imagery
28
+ - Trolling, insulting or derogatory comments
29
+ - Personal or political attacks
30
+ - Public or private harassment
31
+ - Publishing others' private information
32
+ - Other unethical or unprofessional conduct
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying and enforcing our standards of
37
+ acceptable behavior and will take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or reject
41
+ comments, commits, code, wiki edits, issues, and other contributions that are
42
+ not aligned to this Code of Conduct, or to ban temporarily or permanently any
43
+ contributor for other behaviors that they deem inappropriate, threatening,
44
+ offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces, and it also applies when
49
+ an individual is officially representing the project or its community in public
50
+ spaces. Examples of representing a project or community include using an official
51
+ project e-mail address, posting via an official social media account, or acting
52
+ as an appointed representative at an online or offline event.
53
+
54
+ ## Enforcement
55
+
56
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
57
+ reported to the project team at umit@umituz.com. All complaints will be reviewed
58
+ and investigated and will result in a response that is deemed necessary and
59
+ appropriate to the circumstances. The project team is obligated to maintain
60
+ confidentiality with regard to the reporter of an incident.
61
+
62
+ Project maintainers who do not follow or enforce the Code of Conduct in good
63
+ faith may face temporary or permanent repercussions as determined by other
64
+ members of the project's leadership.
65
+
66
+ ## Attribution
67
+
68
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
69
+ version 2.0, available at
70
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
71
+
72
+ [homepage]: https://www.contributor-covenant.org
73
+
74
+ For answers to common questions about this code of conduct, see
75
+ https://www.contributor-covenant.org/faq
@@ -0,0 +1,107 @@
1
+ # Contributing to @umituz/react-native-settings
2
+
3
+ Thank you for your interest in contributing to this package! This document provides guidelines for contributing.
4
+
5
+ ## Purpose
6
+
7
+ This document guides contributors on how to effectively participate in the development of `@umituz/react-native-settings`, ensuring code quality, consistency, and maintainability.
8
+
9
+ ## How to Contribute
10
+
11
+ ### Reporting Issues
12
+
13
+ Before creating issues:
14
+ - Check existing issues for duplicates
15
+ - Use clear, descriptive titles
16
+ - Provide reproduction steps
17
+ - Include environment details (React Native version, platform, etc.)
18
+ - Add screenshots for UI issues
19
+
20
+ ### Submitting Pull Requests
21
+
22
+ 1. Fork the repository
23
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
24
+ 3. Make your changes following our guidelines
25
+ 4. Write tests for new functionality
26
+ 5. Ensure all tests pass
27
+ 6. Commit your changes (`git commit -m 'Add amazing feature'`)
28
+ 7. Push to the branch (`git push origin feature/amazing-feature`)
29
+ 8. Open a Pull Request
30
+
31
+ ## Development Workflow
32
+
33
+ ### Getting Started
34
+
35
+ 1. Clone the repository
36
+ 2. Install dependencies: `npm install`
37
+ 3. Run type checking: `npm run typecheck`
38
+ 4. Run linting: `npm run lint`
39
+
40
+ ### Code Style
41
+
42
+ Follow the existing code style:
43
+ - Use TypeScript strict mode
44
+ - Follow naming conventions
45
+ - Add JSDoc comments for public APIs
46
+ - Use meaningful variable names
47
+ - Keep functions focused and small
48
+
49
+ ### Testing
50
+
51
+ - Write unit tests for new features
52
+ - Maintain test coverage above 80%
53
+ - Test error conditions
54
+ - Include accessibility tests
55
+ - Update documentation for changes
56
+
57
+ ## Project Structure
58
+
59
+ ```
60
+ src/
61
+ ├── domains/ # Feature domains
62
+ ├── presentation/ # UI layer
63
+ ├── application/ # Interfaces
64
+ └── infrastructure/ # Data layer
65
+ ```
66
+
67
+ Follow Domain-Driven Design principles when adding features.
68
+
69
+ ## Documentation
70
+
71
+ All documentation must follow the new format:
72
+ - No code examples
73
+ - Use file paths instead
74
+ - Include Purpose, File Paths, Strategy sections
75
+ - Add Restrictions with ❌ markers
76
+ - Add Rules with ✅ markers
77
+ - Include AI Agent Guidelines
78
+
79
+ See `DOCUMENTATION_TEMPLATE.md` for the template.
80
+
81
+ ## Commit Messages
82
+
83
+ Use clear, descriptive commit messages:
84
+ - `feat:` - New features
85
+ - `fix:` - Bug fixes
86
+ - `docs:` - Documentation changes
87
+ - `refactor:` - Code refactoring
88
+ - `test:` - Adding/updating tests
89
+ - `chore:` - Maintenance tasks
90
+
91
+ Example: `feat(appearance): add custom color palette support`
92
+
93
+ ## Code Review Process
94
+
95
+ 1. All PRs require review
96
+ 2. Address review feedback
97
+ 3. Ensure CI checks pass
98
+ 4. Update documentation as needed
99
+ 5. Squash commits if necessary
100
+
101
+ ## Questions?
102
+
103
+ Feel free to open an issue for questions or discussions.
104
+
105
+ ## License
106
+
107
+ By contributing, you agree that your contributions will be licensed under the MIT License.