@umituz/react-native-ai-generation-content 1.17.231 → 1.17.233

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 (31) hide show
  1. package/README.md +236 -261
  2. package/package.json +1 -1
  3. package/src/domains/content-moderation/README.md +239 -296
  4. package/src/domains/creations/README.md +242 -325
  5. package/src/domains/face-detection/README.md +228 -307
  6. package/src/domains/prompts/README.md +242 -312
  7. package/src/features/ai-hug/README.md +381 -219
  8. package/src/features/ai-kiss/README.md +388 -219
  9. package/src/features/anime-selfie/README.md +327 -256
  10. package/src/features/audio-generation/README.md +352 -309
  11. package/src/features/colorization/README.md +332 -228
  12. package/src/features/couple-future/README.md +387 -212
  13. package/src/features/future-prediction/README.md +391 -221
  14. package/src/features/hd-touch-up/README.md +339 -252
  15. package/src/features/image-captioning/README.md +359 -299
  16. package/src/features/image-to-image/README.md +398 -357
  17. package/src/features/image-to-video/README.md +337 -292
  18. package/src/features/inpainting/README.md +348 -244
  19. package/src/features/meme-generator/README.md +350 -269
  20. package/src/features/photo-restoration/README.md +338 -225
  21. package/src/features/remove-background/README.md +335 -234
  22. package/src/features/remove-object/README.md +341 -288
  23. package/src/features/replace-background/README.md +353 -236
  24. package/src/features/script-generator/README.md +358 -287
  25. package/src/features/shared/README.md +254 -223
  26. package/src/features/sketch-to-image/README.md +331 -234
  27. package/src/features/style-transfer/README.md +336 -237
  28. package/src/features/text-to-video/README.md +360 -193
  29. package/src/features/text-to-voice/README.md +382 -272
  30. package/src/features/upscaling/README.md +340 -191
  31. package/src/presentation/components/result/ResultStoryCard.tsx +1 -1
@@ -2,99 +2,216 @@
2
2
 
3
3
  Gallery and management system for AI-generated content.
4
4
 
5
- ## Overview
5
+ ## 📍 Import Path
6
+
7
+ ```typescript
8
+ import {
9
+ useCreations,
10
+ useCreationDetails,
11
+ useCreationActions,
12
+ saveCreation,
13
+ CreationsGallery,
14
+ CreationCard
15
+ } from '@umituz/react-native-ai-generation-content';
16
+ ```
6
17
 
7
- The Creations domain provides a comprehensive system for managing AI-generated content. It includes features for storing, organizing, filtering, and sharing AI creations across all generation types.
18
+ **Location**: `src/domains/creations/`
8
19
 
9
- ## Features
20
+ ## 🎯 Domain Purpose
10
21
 
11
- - **Content Storage**: Store AI-generated images, videos, and audio
12
- - **Organization**: Organize creations by type, date, and custom tags
13
- - **Filtering & Sorting**: Advanced filtering and sorting options
14
- - **Gallery View**: Beautiful gallery grid for browsing creations
15
- - **Sharing**: Share creations to social media and other platforms
16
- - **Favorites**: Mark and organize favorite creations
17
- - **Metadata Management**: Track generation parameters and metadata
22
+ Comprehensive system for managing AI-generated content. Store, organize, filter, and share AI creations across all generation types with gallery views, favorites, metadata management, and advanced filtering capabilities.
18
23
 
19
- ## Installation
24
+ ---
20
25
 
21
- This domain is part of `@umituz/react-native-ai-generation-content`.
26
+ ## 📋 Usage Strategy
22
27
 
23
- ```bash
24
- npm install @umituz/react-native-ai-generation-content
25
- ```
28
+ ### When to Use This Domain
26
29
 
27
- ## Basic Usage
28
-
29
- ### Using Creations Hook
30
-
31
- ```tsx
32
- import { useCreations } from '@umituz/react-native-ai-generation-content';
33
-
34
- function CreationsGallery() {
35
- const {
36
- creations,
37
- loading,
38
- error,
39
- filters,
40
- setFilters,
41
- loadMore,
42
- refresh,
43
- deleteCreation,
44
- toggleFavorite,
45
- } = useCreations({
46
- userId: 'user-123',
47
- type: 'image', // 'image' | 'video' | 'audio' | 'all'
48
- });
49
-
50
- if (loading) return <ActivityIndicator />;
51
- if (error) return <Text>Error: {error}</Text>;
52
-
53
- return (
54
- <FlatGrid
55
- data={creations}
56
- renderItem={({ item }) => (
57
- <CreationCard
58
- creation={item}
59
- onPress={() => viewCreation(item)}
60
- onDelete={() => deleteCreation(item.id)}
61
- onFavorite={() => toggleFavorite(item.id)}
62
- />
63
- )}
64
- onEndReached={loadMore}
65
- onEndReachedThreshold={0.5}
66
- />
67
- );
68
- }
69
- ```
30
+ **Use Cases:**
31
+ - Storing AI-generated images, videos, audio
32
+ - Building creation galleries
33
+ - Organizing content with tags/filters
34
+ - Sharing creations to social media
35
+ - Managing user content libraries
70
36
 
71
- ### Saving Creations
37
+ **When NOT to Use:**
38
+ - Replacing cloud storage (use proper backend)
39
+ - Storing large files locally only
40
+ - Real-time collaboration (use specialized tools)
41
+ - Content delivery (use CDN)
72
42
 
73
- ```tsx
74
- import { saveCreation } from '@umituz/react-native-ai-generation-content';
43
+ ### Implementation Strategy
75
44
 
76
- // After generating content
77
- const result = await generateImage({ prompt: '...' });
45
+ 1. **Save creations** immediately after generation
46
+ 2. **Organize with tags** for easy filtering
47
+ 3. **Implement filtering** by type, date, feature
48
+ 4. **Add gallery view** for browsing
49
+ 5. **Enable sharing** to social platforms
50
+ 6. **Track metadata** for all creations
51
+ 7. **Implement favorites** for easy access
52
+
53
+ ---
54
+
55
+ ## ⚠️ Critical Rules (MUST FOLLOW)
56
+
57
+ ### 1. Storage Requirements
58
+ - **MUST** save creations immediately after generation
59
+ - **MUST** store metadata with creations
60
+ - **MUST** implement proper error handling
61
+ - **MUST** handle storage limits
62
+ - **MUST** implement cleanup for old creations
63
+
64
+ ### 2. Organization
65
+ - **MUST** tag creations properly
66
+ - **MUST** organize by type and feature
67
+ - **MUST** enable filtering and sorting
68
+ - **MUST** implement search functionality
69
+ - **MUST** support favorites
70
+
71
+ ### 3. Performance
72
+ - **MUST** implement lazy loading
73
+ - **MUST** cache thumbnails
74
+ - **MUST** paginate large galleries
75
+ - **MUST** optimize image loading
76
+ - **MUST** handle large datasets
77
+
78
+ ### 4. User Experience
79
+ - **MUST** provide clear gallery UI
80
+ - **MUST** enable quick actions
81
+ - **MUST** show creation metadata
82
+ - **MUST** implement sharing functionality
83
+ - **MUST** support deletion and management
84
+
85
+ ### 5. Privacy & Security
86
+ - **MUST** respect user privacy
87
+ - **MUST** implement proper permissions
88
+ - **MUST** secure sensitive content
89
+ - **MUST** handle user data properly
90
+ - **MUST** comply with regulations
91
+
92
+ ---
93
+
94
+ ## 🚫 Prohibitions (MUST AVOID)
95
+
96
+ ### Strictly Forbidden
97
+
98
+ ❌ **NEVER** do the following:
99
+
100
+ 1. **No Missing Metadata**
101
+ - Always save generation parameters
102
+ - Never save without context
103
+ - Track prompt, model, settings
104
+
105
+ 2. **No Poor Organization**
106
+ - Always tag and categorize
107
+ - Never dump all creations together
108
+ - Implement proper filtering
109
+
110
+ 3. **No Performance Issues**
111
+ - Never load all creations at once
112
+ - Always implement pagination
113
+ - Cache thumbnails efficiently
114
+
115
+ 4. **No Data Loss**
116
+ - Never delete without user action
117
+ - Always confirm deletions
118
+ - Implement backup/restore
119
+
120
+ 5. **No Privacy Violations**
121
+ - Never expose private content
122
+ - Always check permissions
123
+ - Implement proper access control
124
+
125
+ 6. **No Blocking UI**
126
+ - Never block on large operations
127
+ - Always show progress
128
+ - Implement background processing
129
+
130
+ 7. **No Missing Context**
131
+ - Always show when/what created
132
+ - Display generation parameters
133
+ - Provide creation history
134
+
135
+ ---
136
+
137
+ ## 🤖 AI Agent Directions
138
+
139
+ ### For AI Code Generation Tools
140
+
141
+ #### Prompt Template for AI Agents
78
142
 
79
- await saveCreation({
80
- userId: 'user-123',
81
- type: 'image',
82
- url: result.imageUrl,
83
- metadata: {
84
- prompt: '...',
85
- model: 'imagen-3',
86
- aspectRatio: '16:9',
87
- style: 'realistic',
88
- createdAt: new Date().toISOString(),
89
- },
90
- });
91
143
  ```
144
+ You are implementing creation management using @umituz/react-native-ai-generation-content.
145
+
146
+ REQUIREMENTS:
147
+ 1. Import creation management functions
148
+ 2. Save creations immediately after generation
149
+ 3. Organize with tags and metadata
150
+ 4. Implement filtering and sorting
151
+ 5. Add gallery view with lazy loading
152
+ 6. Enable sharing functionality
153
+ 7. Handle deletions properly
154
+ 8. Optimize for performance
155
+
156
+ CRITICAL RULES:
157
+ - MUST save with complete metadata
158
+ - MUST organize by type and feature
159
+ - MUST implement pagination/lazy loading
160
+ - MUST provide clear gallery UI
161
+ - MUST handle large datasets efficiently
162
+ - MUST respect user privacy
163
+
164
+ CREATION TYPES:
165
+ - Image: Generated images
166
+ - Video: Generated videos
167
+ - Audio: Generated audio
168
+
169
+ FILTERING OPTIONS:
170
+ - type: image | video | audio | all
171
+ - featureType: text-to-image | face-swap | etc.
172
+ - tags: Custom tags array
173
+ - dateFrom/dateTo: Date range
174
+ - isFavorite: Boolean filter
175
+ - sortBy: createdAt | updatedAt
176
+ - sortOrder: asc | desc
177
+
178
+ ACTIONS:
179
+ - saveToGallery: Save to device
180
+ - shareToSocialMedia: Share to platforms
181
+ - download: Download to device
182
+ - delete: Remove creation
183
+ - duplicate: Copy creation
184
+ - exportMetadata: Export metadata
185
+
186
+ STRICTLY FORBIDDEN:
187
+ - No missing metadata
188
+ - No poor organization
189
+ - No performance issues
190
+ - No data loss
191
+ - No privacy violations
192
+ - No blocking UI
193
+ - No missing context
194
+
195
+ QUALITY CHECKLIST:
196
+ - [ ] Creations saved with metadata
197
+ - [ ] Tags and categories implemented
198
+ - [ ] Filtering and sorting working
199
+ - [ ] Gallery with lazy loading
200
+ - [ ] Sharing functionality
201
+ - [ ] Delete with confirmation
202
+ - [ ] Performance optimized
203
+ - [ ] Privacy protected
204
+ - [ ] Error handling
205
+ - [ ] User feedback
206
+ ```
207
+
208
+ ---
92
209
 
93
- ## Data Models
210
+ ## 🛠️ Configuration Strategy
94
211
 
95
- ### Creation
212
+ ### Creation Structure
96
213
 
97
- ```tsx
214
+ ```typescript
98
215
  interface Creation {
99
216
  id: string;
100
217
  userId: string;
@@ -114,281 +231,81 @@ interface Creation {
114
231
  }
115
232
  ```
116
233
 
117
- ### CreationsFilter
234
+ ### Filter Options
118
235
 
119
- ```tsx
236
+ ```typescript
120
237
  interface CreationsFilter {
121
238
  type?: 'image' | 'video' | 'audio' | 'all';
122
- featureType?: string; // e.g., 'text-to-image', 'face-swap'
239
+ featureType?: string;
123
240
  tags?: string[];
124
241
  dateFrom?: Date;
125
242
  dateTo?: Date;
126
243
  isFavorite?: boolean;
127
- sortBy?: 'createdAt' | 'updatedAt' | 'name';
244
+ sortBy?: 'createdAt' | 'updatedAt';
128
245
  sortOrder?: 'asc' | 'desc';
129
246
  }
130
247
  ```
131
248
 
132
- ## Hooks
133
-
134
- ### useCreations
135
-
136
- Main hook for managing creations:
137
-
138
- ```tsx
139
- const {
140
- creations,
141
- loading,
142
- error,
143
- hasMore,
144
- filters,
145
- setFilters,
146
- loadMore,
147
- refresh,
148
- deleteCreation,
149
- toggleFavorite,
150
- updateTags,
151
- getCreation,
152
- } = useCreations(options);
153
- ```
154
-
155
- ### useCreationDetails
156
-
157
- Get details of a specific creation:
158
-
159
- ```tsx
160
- import { useCreationDetails } from '@umituz/react-native-ai-generation-content';
161
-
162
- function CreationDetailScreen({ creationId }) {
163
- const { creation, loading, error, updateMetadata, share } = useCreationDetails({
164
- creationId,
165
- });
166
-
167
- if (loading) return <ActivityIndicator />;
168
- if (error) return <Text>Error: {error}</Text>;
169
-
170
- return (
171
- <View>
172
- <Image source={{ uri: creation.url }} />
173
- <Text>Prompt: {creation.metadata.prompt}</Text>
174
- <Text>Created: {new Date(creation.createdAt).toLocaleDateString()}</Text>
175
- <Button title="Share" onPress={() => share(creation)} />
176
- </View>
177
- );
178
- }
179
- ```
180
-
181
- ### useCreationActions
249
+ ---
182
250
 
183
- Actions for creations:
251
+ ## 📊 Core Components
184
252
 
185
- ```tsx
186
- import { useCreationActions } from '@umituz/react-native-ai-generation-content';
253
+ ### Hooks
254
+ - `useCreations` - Main gallery management
255
+ - `useCreationDetails` - Individual creation details
256
+ - `useCreationActions` - Actions (save, share, delete)
187
257
 
188
- const {
189
- saveToGallery,
190
- shareToSocialMedia,
191
- download,
192
- delete: deleteCreation,
193
- duplicate,
194
- exportMetadata,
195
- } = useCreationActions();
258
+ ### Components
259
+ - `CreationsGallery` - Gallery grid view
260
+ - `CreationCard` - Individual creation card
261
+ - `CreationFilterBar` - Filter controls
196
262
 
197
- // Save to device gallery
198
- await saveToGallery(creation);
263
+ ### Repositories
264
+ - `CreationsRepository` - Data access layer
265
+ - Custom repositories supported
199
266
 
200
- // Share to social media
201
- await shareToSocialMedia({
202
- creation,
203
- platform: 'instagram', // 'instagram' | 'facebook' | 'twitter' | 'whatsapp'
204
- });
267
+ ---
205
268
 
206
- // Download to device
207
- await download(creation);
269
+ ## 🎨 Best Practices
208
270
 
209
- // Delete creation
210
- await deleteCreation(creation.id);
271
+ ### Metadata
272
+ - Save all generation parameters
273
+ - Include prompt, model, settings
274
+ - Track creation timestamp
275
+ - Store feature-specific data
211
276
 
212
- // Duplicate creation
213
- await duplicate(creation);
277
+ ### Organization
278
+ - Use consistent tagging
279
+ - Categorize by feature type
280
+ - Enable smart collections
281
+ - Implement search
214
282
 
215
- // Export metadata
216
- const metadata = await exportMetadata(creation);
217
- ```
218
-
219
- ## Components
220
-
221
- ### CreationsGallery
222
-
223
- ```tsx
224
- import { CreationsGallery } from '@umituz/react-native-ai-generation-content';
225
-
226
- <CreationsGallery
227
- userId="user-123"
228
- type="image"
229
- filters={{
230
- featureType: 'text-to-image',
231
- isFavorite: false,
232
- sortBy: 'createdAt',
233
- sortOrder: 'desc',
234
- }}
235
- onCreationPress={(creation) => console.log('Pressed:', creation)}
236
- onCreationLongPress={(creation) => console.log('Long pressed:', creation)}
237
- onRefresh={() => console.log('Refreshed')}
238
- />
239
- ```
283
+ ### Performance
284
+ - Lazy load galleries
285
+ - Cache thumbnails
286
+ - Paginate large datasets
287
+ - Optimize image loading
288
+ - Background operations
240
289
 
241
- ### CreationCard
290
+ ---
242
291
 
243
- ```tsx
244
- import { CreationCard } from '@umituz/react-native-ai-generation-content';
245
-
246
- <CreationCard
247
- creation={creation}
248
- onPress={() => viewCreation(creation)}
249
- onLongPress={() => showOptions(creation)}
250
- showMetadata
251
- showFavoriteButton
252
- onFavoriteToggle={() => toggleFavorite(creation.id)}
253
- />
254
- ```
255
-
256
- ### CreationFilterBar
257
-
258
- ```tsx
259
- import { CreationFilterBar } from '@umituz/react-native-ai-generation-content';
260
-
261
- <CreationFilterBar
262
- filters={filters}
263
- onFiltersChange={setFilters}
264
- availableTypes={['image', 'video', 'audio']}
265
- availableFeatures={['text-to-image', 'face-swap', 'style-transfer']}
266
- availableTags={['portrait', 'landscape', 'artistic']}
267
- />
268
- ```
269
-
270
- ## Filtering Examples
271
-
272
- ### Filter by Type
273
-
274
- ```tsx
275
- setFilters({
276
- type: 'image',
277
- });
278
- ```
279
-
280
- ### Filter by Feature
281
-
282
- ```tsx
283
- setFilters({
284
- featureType: 'text-to-image',
285
- });
286
- ```
287
-
288
- ### Filter by Date Range
289
-
290
- ```tsx
291
- setFilters({
292
- dateFrom: new Date('2024-01-01'),
293
- dateTo: new Date('2024-12-31'),
294
- });
295
- ```
296
-
297
- ### Filter by Tags
298
-
299
- ```tsx
300
- setFilters({
301
- tags: ['portrait', 'artistic'],
302
- });
303
- ```
304
-
305
- ### Filter by Favorites
306
-
307
- ```tsx
308
- setFilters({
309
- isFavorite: true,
310
- });
311
- ```
312
-
313
- ### Sort Options
314
-
315
- ```tsx
316
- setFilters({
317
- sortBy: 'createdAt',
318
- sortOrder: 'desc', // Newest first
319
- });
320
- ```
321
-
322
- ## Advanced Usage
323
-
324
- ### Custom Storage Backend
325
-
326
- ```tsx
327
- import { CreationsRepository } from '@umituz/react-native-ai-generation-content';
328
-
329
- class CustomCreationsRepository extends CreationsRepository {
330
- async save(creation: Creation): Promise<void> {
331
- // Custom save logic (e.g., to your own backend)
332
- await api.post('/creations', creation);
333
- }
334
-
335
- async getAll(filters: CreationsFilter): Promise<Creation[]> {
336
- // Custom fetch logic
337
- const response = await api.get('/creations', { params: filters });
338
- return response.data;
339
- }
340
- }
341
- ```
342
-
343
- ### Batch Operations
344
-
345
- ```tsx
346
- import { batchDeleteCreations, batchUpdateTags } from '@umituz/react-native-ai-generation-content';
347
-
348
- // Delete multiple creations
349
- await batchDeleteCreations(['id1', 'id2', 'id3']);
350
-
351
- // Update tags for multiple creations
352
- await batchUpdateTags({
353
- creationIds: ['id1', 'id2', 'id3'],
354
- tags: ['portrait', 'professional'],
355
- mode: 'replace', // 'replace' | 'append' | 'remove'
356
- });
357
- ```
358
-
359
- ### Export Creations
360
-
361
- ```tsx
362
- import { exportCreations, exportCreationMetadata } from '@umituz/react-native-ai-generation-content';
363
-
364
- // Export creations to ZIP
365
- const zipFile = await exportCreations({
366
- creationIds: ['id1', 'id2', 'id3'],
367
- includeMetadata: true,
368
- format: 'zip',
369
- });
370
-
371
- // Export metadata as JSON
372
- const metadata = await exportCreationMetadata({
373
- creationIds: ['id1', 'id2', 'id3'],
374
- format: 'json',
375
- });
376
- ```
292
+ ## 🐛 Common Pitfalls
377
293
 
378
- ## Best Practices
294
+ **Missing metadata**: Always save context
295
+ ❌ **Poor performance**: Implement pagination
296
+ ❌ **No organization**: Tag and filter properly
297
+ ❌ **Data loss**: Confirm deletions, backup
298
+ ❌ **Privacy issues**: Check permissions
379
299
 
380
- 1. **Metadata**: Always save relevant metadata for future reference
381
- 2. **Tagging**: Use consistent tagging for easy organization
382
- 3. **Cleanup**: Regularly clean up unwanted creations
383
- 4. **Backup**: Implement backup for important creations
384
- 5. **Privacy**: Respect user privacy when storing creations
300
+ ---
385
301
 
386
- ## Related Features
302
+ ## 📚 Related Domains
387
303
 
388
304
  - [Prompts](../prompts) - AI prompt management
389
305
  - [Content Moderation](../content-moderation) - Content moderation
390
306
  - [Face Detection](../face-detection) - Face detection API
391
307
 
392
- ## License
308
+ ---
393
309
 
394
- MIT
310
+ **Last Updated**: 2025-01-08
311
+ **Version**: 2.0.0 (Strategy-based Documentation)