@umituz/react-native-ai-generation-content 1.17.229 โ†’ 1.17.230

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +346 -0
  3. package/package.json +1 -3
  4. package/src/domain/README.md +503 -0
  5. package/src/domains/content-moderation/README.md +363 -0
  6. package/src/domains/creations/README.md +394 -0
  7. package/src/domains/face-detection/README.md +395 -0
  8. package/src/domains/prompts/README.md +387 -0
  9. package/src/features/ai-hug/README.md +276 -0
  10. package/src/features/ai-kiss/README.md +276 -0
  11. package/src/features/anime-selfie/README.md +325 -0
  12. package/src/features/audio-generation/README.md +370 -0
  13. package/src/features/colorization/README.md +289 -0
  14. package/src/features/couple-future/README.md +270 -0
  15. package/src/features/face-swap/README.md +234 -0
  16. package/src/features/future-prediction/README.md +281 -0
  17. package/src/features/hd-touch-up/README.md +309 -0
  18. package/src/features/image-captioning/README.md +361 -0
  19. package/src/features/image-to-image/README.md +418 -0
  20. package/src/features/image-to-video/README.md +369 -0
  21. package/src/features/inpainting/README.md +302 -0
  22. package/src/features/meme-generator/README.md +327 -0
  23. package/src/features/photo-restoration/README.md +286 -0
  24. package/src/features/remove-background/README.md +292 -0
  25. package/src/features/remove-object/README.md +352 -0
  26. package/src/features/replace-background/README.md +288 -0
  27. package/src/features/script-generator/README.md +362 -0
  28. package/src/features/shared/README.md +280 -0
  29. package/src/features/sketch-to-image/README.md +296 -0
  30. package/src/features/style-transfer/README.md +301 -0
  31. package/src/features/text-to-image/README.md +228 -0
  32. package/src/features/text-to-video/README.md +245 -0
  33. package/src/features/text-to-voice/README.md +335 -0
  34. package/src/features/upscaling/README.md +247 -0
  35. package/src/infrastructure/config/README.md +310 -0
  36. package/src/infrastructure/middleware/README.md +378 -0
  37. package/src/infrastructure/orchestration/README.md +362 -0
  38. package/src/infrastructure/services/README.md +382 -0
  39. package/src/infrastructure/utils/README.md +523 -0
  40. package/src/infrastructure/wrappers/README.md +336 -0
  41. package/src/presentation/components/README.md +535 -0
  42. package/src/presentation/hooks/README.md +380 -0
  43. package/src/presentation/layouts/README.md +374 -0
  44. package/src/presentation/screens/README.md +430 -0
  45. package/src/presentation/layouts/types/.npmignore.tmp +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Umit Uz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,346 @@
1
+ # @umituz/react-native-ai-generation-content
2
+
3
+ > Provider-agnostic AI generation orchestration for React Native
4
+
5
+ A comprehensive React Native library for AI-powered content generation, supporting multiple providers and offering a wide range of AI features including image generation, video creation, text-to-speech, face swap, and much more.
6
+
7
+ ## ๐Ÿš€ Features
8
+
9
+ - **๐ŸŽจ Text to Image**: Generate stunning images from text descriptions
10
+ - **๐ŸŽฌ Text to Video**: Create videos from text prompts
11
+ - **๐ŸŽค Text to Voice**: Convert text to natural-sounding speech
12
+ - **๐Ÿ”„ Face Swap**: Swap faces between images with AI
13
+ - **๐Ÿ–ผ๏ธ Style Transfer**: Apply artistic styles to photos
14
+ - **โœจ Photo Restoration**: Restore and enhance old photos
15
+ - **๐Ÿ” Upscaling**: Increase image resolution while maintaining quality
16
+ - **๐ŸŽญ AI Hug & Kiss**: Generate creative AI-powered interactions
17
+ - **๐ŸŒ… Background Removal/Replacement**: Remove or replace image backgrounds
18
+ - **๐ŸŽช Anime Selfie**: Convert photos to anime style
19
+ - **๐Ÿ“ Image Captioning**: Generate descriptive captions for images
20
+ - **๐ŸŽต Audio Generation**: Create audio content with AI
21
+ - **๐Ÿ“œ Script Generator**: Generate scripts for videos and podcasts
22
+ - **๐Ÿ”ฎ Future Prediction**: See yourself in future scenarios
23
+
24
+ ## ๐Ÿ“ฆ Installation
25
+
26
+ ```bash
27
+ npm install @umituz/react-native-ai-generation-content
28
+ ```
29
+
30
+ or
31
+
32
+ ```bash
33
+ yarn add @umituz/react-native-ai-generation-content
34
+ ```
35
+
36
+ ## ๐Ÿ Quick Start
37
+
38
+ ### 1. Configure App Services
39
+
40
+ ```tsx
41
+ import { configureAppServices } from '@umituz/react-native-ai-generation-content';
42
+
43
+ // Configure required services
44
+ configureAppServices({
45
+ networkService: {
46
+ baseUrl: 'https://your-api.com',
47
+ apiKey: 'your-api-key',
48
+ },
49
+ creditService: {
50
+ checkCredits: async (userId, cost) => {
51
+ // Check if user has enough credits
52
+ return true;
53
+ },
54
+ deductCredits: async (userId, cost) => {
55
+ // Deduct credits from user
56
+ },
57
+ },
58
+ paywallService: {
59
+ showPaywall: async () => {
60
+ // Show paywall if needed
61
+ return true;
62
+ },
63
+ },
64
+ });
65
+ ```
66
+
67
+ ### 2. Use a Feature Hook
68
+
69
+ ```tsx
70
+ import { useTextToImageFeature } from '@umituz/react-native-ai-generation-content';
71
+
72
+ function TextToImageScreen() {
73
+ const feature = useTextToImageFeature({
74
+ config: {
75
+ model: 'imagen-3',
76
+ onProcessingComplete: (result) => {
77
+ console.log('Image generated:', result.imageUrl);
78
+ },
79
+ },
80
+ userId: 'user-123',
81
+ });
82
+
83
+ return (
84
+ <View>
85
+ <TextInput
86
+ placeholder="Describe the image you want..."
87
+ onChangeText={feature.setPrompt}
88
+ value={feature.state.prompt}
89
+ />
90
+
91
+ <Button
92
+ title="Generate Image"
93
+ onPress={() => feature.generate()}
94
+ disabled={!feature.isReady}
95
+ />
96
+
97
+ {feature.state.isProcessing && (
98
+ <Text>Generating... {feature.state.progress}%</Text>
99
+ )}
100
+
101
+ {feature.state.imageUrl && (
102
+ <Image source={{ uri: feature.state.imageUrl }} />
103
+ )}
104
+ </View>
105
+ );
106
+ }
107
+ ```
108
+
109
+ ### 3. Or Use the Unified AI Feature Screen
110
+
111
+ ```tsx
112
+ import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
113
+
114
+ function App() {
115
+ return (
116
+ <AIFeatureScreen
117
+ featureId="text-to-image"
118
+ userId="user-123"
119
+ />
120
+ );
121
+ }
122
+ ```
123
+
124
+ ## ๐Ÿ“š Available Features
125
+
126
+ ### Text Generation
127
+ - [Text to Image](./src/features/text-to-image/README.md)
128
+ - [Text to Video](./src/features/text-to-video/README.md)
129
+ - [Text to Voice](./src/features/text-to-voice/README.md)
130
+
131
+ ### Image Processing
132
+ - [Face Swap](./src/features/face-swap/README.md)
133
+ - [Photo Restoration](./src/features/photo-restoration/README.md)
134
+ - [Upscaling](./src/features/upscaling/README.md)
135
+ - [Style Transfer](./src/features/style-transfer/README.md)
136
+ - [HD Touch Up](./src/features/hd-touch-up/README.md)
137
+ - [Colorization](./src/features/colorization/README.md)
138
+ - [Image to Image](./src/features/image-to-image/README.md)
139
+
140
+ ### Background & Object Manipulation
141
+ - [Remove Background](./src/features/remove-background/README.md)
142
+ - [Replace Background](./src/features/replace-background/README.md)
143
+ - [Remove Object](./src/features/remove-object/README.md)
144
+ - [Inpainting](./src/features/inpainting/README.md)
145
+
146
+ ### Special Effects
147
+ - [AI Hug](./src/features/ai-hug/README.md)
148
+ - [AI Kiss](./src/features/ai-kiss/README.md)
149
+ - [Anime Selfie](./src/features/anime-selfie/README.md)
150
+ - [Meme Generator](./src/features/meme-generator/README.md)
151
+ - [Couple Future](./src/features/couple-future/README.md)
152
+ - [Future Prediction](./src/features/future-prediction/README.md)
153
+ - [Sketch to Image](./src/features/sketch-to-image/README.md)
154
+
155
+ ### Video & Audio
156
+ - [Image to Video](./src/features/image-to-video/README.md)
157
+ - [Audio Generation](./src/features/audio-generation/README.md)
158
+
159
+ ### Content & Scripting
160
+ - [Image Captioning](./src/features/image-captioning/README.md)
161
+ - [Script Generator](./src/features/script-generator/README.md)
162
+
163
+ ## ๐Ÿ—๏ธ Architecture
164
+
165
+ ### Domain-Driven Design
166
+
167
+ The library follows clean architecture principles with clear separation of concerns:
168
+
169
+ ```
170
+ src/
171
+ โ”œโ”€โ”€ domain/ # Core business logic and types
172
+ โ”œโ”€โ”€ infrastructure/ # External services and implementations
173
+ โ”œโ”€โ”€ presentation/ # UI components and hooks
174
+ โ”œโ”€โ”€ domains/ # Domain-specific modules
175
+ โ”‚ โ”œโ”€โ”€ prompts/ # AI prompt management
176
+ โ”‚ โ”œโ”€โ”€ content-moderation/ # Content moderation
177
+ โ”‚ โ”œโ”€โ”€ creations/ # AI-generated content gallery
178
+ โ”‚ โ””โ”€โ”€ face-detection/ # Face detection API
179
+ โ””โ”€โ”€ features/ # Individual AI features
180
+ ```
181
+
182
+ ### Core Modules
183
+
184
+ - **Prompts Domain**: AI prompt management and generation
185
+ - **Content Moderation**: Content safety and filtering
186
+ - **Creations**: Gallery for managing AI-generated content
187
+ - **Face Detection**: Face detection and analysis
188
+
189
+ ## ๐ŸŽจ UI Components
190
+
191
+ The library provides ready-to-use components:
192
+
193
+ ```tsx
194
+ import {
195
+ GenerationProgressModal,
196
+ DualImagePicker,
197
+ PromptInput,
198
+ ResultDisplay,
199
+ StyleSelector,
200
+ AspectRatioSelector,
201
+ AIGenerationForm,
202
+ } from '@umituz/react-native-ai-generation-content';
203
+ ```
204
+
205
+ ## ๐Ÿ”ง Configuration
206
+
207
+ ### Provider Configuration
208
+
209
+ ```tsx
210
+ import { providerRegistry } from '@umituz/react-native-ai-generation-content';
211
+
212
+ // Register a custom provider
213
+ providerRegistry.registerProvider({
214
+ id: 'my-provider',
215
+ name: 'My AI Provider',
216
+ capabilities: {
217
+ textToImage: true,
218
+ textToVideo: false,
219
+ // ...
220
+ },
221
+ execute: async (request) => {
222
+ // Provider-specific implementation
223
+ },
224
+ });
225
+ ```
226
+
227
+ ### Middleware
228
+
229
+ ```tsx
230
+ import {
231
+ createCreditCheckMiddleware,
232
+ createHistoryTrackingMiddleware,
233
+ } from '@umituz/react-native-ai-generation-content';
234
+
235
+ // Add credit check middleware
236
+ const creditMiddleware = createCreditCheckMiddleware({
237
+ creditCost: 1,
238
+ paywallThreshold: 5,
239
+ });
240
+
241
+ // Add history tracking middleware
242
+ const historyMiddleware = createHistoryTrackingMiddleware({
243
+ maxHistorySize: 100,
244
+ });
245
+ ```
246
+
247
+ ## ๐Ÿ“– Examples
248
+
249
+ ### Face Swap
250
+
251
+ ```tsx
252
+ import { useFaceSwapFeature } from '@umituz/react-native-ai-generation-content';
253
+
254
+ const feature = useFaceSwapFeature({
255
+ config: {
256
+ enhanceFace: true,
257
+ matchSkinTone: true,
258
+ },
259
+ onSelectSourceImage: async () => { /* ... */ },
260
+ onSelectTargetImage: async () => { /* ... */ },
261
+ onSaveImage: async (url) => { /* ... */ },
262
+ });
263
+
264
+ await feature.process();
265
+ ```
266
+
267
+ ### Photo Restoration
268
+
269
+ ```tsx
270
+ import { usePhotoRestoreFeature } from '@umituz/react-native-ai-generation-content';
271
+
272
+ const feature = usePhotoRestoreFeature({
273
+ config: {
274
+ restorationType: 'auto',
275
+ },
276
+ onSelectPhoto: async () => { /* ... */ },
277
+ onSaveResult: async (url) => { /* ... */ },
278
+ });
279
+
280
+ await feature.process();
281
+ ```
282
+
283
+ ### Text to Video
284
+
285
+ ```tsx
286
+ import { useTextToVideoFeature } from '@umituz/react-native-ai-generation-content';
287
+
288
+ const feature = useTextToVideoFeature({
289
+ config: {
290
+ model: 'veo-3',
291
+ },
292
+ userId: 'user-123',
293
+ });
294
+
295
+ await feature.generate({
296
+ duration: 5,
297
+ aspectRatio: '16:9',
298
+ });
299
+ ```
300
+
301
+ ## ๐Ÿงช Testing
302
+
303
+ ```tsx
304
+ import { renderHook, waitFor } from '@testing-library/react-native';
305
+ import { useTextToImageFeature } from '@umituz/react-native-ai-generation-content';
306
+
307
+ test('generates image from prompt', async () => {
308
+ const { result } = renderHook(() =>
309
+ useTextToImageFeature({
310
+ config: {},
311
+ userId: 'test-user',
312
+ })
313
+ );
314
+
315
+ await act(async () => {
316
+ await result.current.generate({ prompt: 'Test prompt' });
317
+ });
318
+
319
+ await waitFor(() => {
320
+ expect(result.current.state.imageUrl).toBeTruthy();
321
+ });
322
+ });
323
+ ```
324
+
325
+ ## ๐Ÿค Contributing
326
+
327
+ Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
328
+
329
+ ## ๐Ÿ“„ License
330
+
331
+ MIT ยฉ [Umit Uz]
332
+
333
+ ## ๐Ÿ”— Links
334
+
335
+ - [Documentation](./docs)
336
+ - [Examples](./examples)
337
+ - [Changelog](./CHANGELOG.md)
338
+ - [Report Issues](https://github.com/umituz/react-native-ai-generation-content/issues)
339
+
340
+ ## โญ Star Us
341
+
342
+ If you find this library helpful, please consider giving it a star on GitHub!
343
+
344
+ ---
345
+
346
+ Made with โค๏ธ by [Umit Uz]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.229",
3
+ "version": "1.17.230",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -51,7 +51,6 @@
51
51
  "@react-navigation/native": ">=6.0.0",
52
52
  "@tanstack/react-query": ">=5.0.0",
53
53
  "@umituz/react-native-video-editor": ">=1.0.0",
54
- "expo-linear-gradient": ">=15.0.0",
55
54
  "firebase": ">=10.0.0",
56
55
  "react": ">=18.0.0",
57
56
  "react-native": ">=0.74.0",
@@ -88,7 +87,6 @@
88
87
  "expo-file-system": "^19.0.21",
89
88
  "expo-haptics": "^15.0.8",
90
89
  "expo-image": "^3.0.11",
91
- "expo-linear-gradient": "~15.0.7",
92
90
  "expo-localization": "^17.0.8",
93
91
  "expo-network": "^8.0.8",
94
92
  "expo-sharing": "^14.0.8",