@umituz/react-native-ai-generation-content 1.83.94 → 1.83.96

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.83.94",
3
+ "version": "1.83.96",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -23,8 +23,10 @@ interface GalleryResultPreviewProps {
23
23
  readonly onRate: () => void;
24
24
  readonly onSubmitRating: (rating: number, description: string) => void;
25
25
  readonly onCloseRating: () => void;
26
- /** Called when the user taps Edit. Only provided for image (non-video) creations. */
26
+ /** Called when the user taps Edit on an image creation. */
27
27
  readonly onEdit?: (imageUrl: string) => void;
28
+ /** Called when the user taps Edit on a video creation. */
29
+ readonly onEditVideo?: (videoUrl: string) => void;
28
30
  }
29
31
 
30
32
  export function GalleryResultPreview({
@@ -40,6 +42,7 @@ export function GalleryResultPreview({
40
42
  onSubmitRating,
41
43
  onCloseRating,
42
44
  onEdit,
45
+ onEditVideo,
43
46
  }: GalleryResultPreviewProps) {
44
47
  const alert = useAlert();
45
48
 
@@ -65,6 +68,7 @@ export function GalleryResultPreview({
65
68
  onNavigateBack={onBack}
66
69
  onRate={onRate}
67
70
  onEdit={!videoUrl && imageUrl && onEdit ? () => onEdit(imageUrl) : undefined}
71
+ onEditVideo={videoUrl && onEditVideo ? () => onEditVideo(videoUrl) : undefined}
68
72
  hideLabel
69
73
  iconOnly
70
74
  showTryAgain
@@ -33,6 +33,7 @@ export function CreationsGalleryScreen({
33
33
  getCreationTitle,
34
34
  onCreationPress,
35
35
  onEdit,
36
+ onEditVideo,
36
37
  }: CreationsGalleryScreenProps) {
37
38
  const tokens = useAppDesignTokens();
38
39
  const [viewMode, setViewMode] = useState<"list" | "grid">("list");
@@ -184,6 +185,7 @@ export function CreationsGalleryScreen({
184
185
  onSubmitRating={callbacks.handleSubmitRating}
185
186
  onCloseRating={() => galleryState.setShowRatingPicker(false)}
186
187
  onEdit={onEdit}
188
+ onEditVideo={onEditVideo}
187
189
  />
188
190
  );
189
191
  }
@@ -24,4 +24,6 @@ export interface CreationsGalleryScreenProps {
24
24
  readonly onCreationPress?: (creation: { id: string; uri: string; type: string; originalUri?: string; output?: { imageUrl?: string; videoUrl?: string }; metadata?: Record<string, unknown> }) => void;
25
25
  /** Called when the user taps the Edit button in the creation detail view. Receives the image URL. Only shown for image creations. */
26
26
  readonly onEdit?: (imageUrl: string) => void;
27
+ /** Called when the user taps the Edit button in the creation detail view. Receives the video URL. Only shown for video creations. */
28
+ readonly onEditVideo?: (videoUrl: string) => void;
27
29
  }
@@ -24,6 +24,7 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
24
24
  showTryAgain = true,
25
25
  showRating = false,
26
26
  onEdit,
27
+ onEditVideo,
27
28
  }) => {
28
29
  const tokens = useAppDesignTokens();
29
30
  const { minTouchTarget } = useResponsive();
@@ -124,6 +125,15 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
124
125
  <AtomicIcon name="edit" customSize={20} color="onPrimary" />
125
126
  </TouchableOpacity>
126
127
  )}
128
+ {onEditVideo && (
129
+ <TouchableOpacity
130
+ style={styles.iconButton}
131
+ onPress={onEditVideo}
132
+ activeOpacity={0.7}
133
+ >
134
+ <AtomicIcon name="video" customSize={20} color="onPrimary" />
135
+ </TouchableOpacity>
136
+ )}
127
137
  </View>
128
138
  );
129
139
  }
@@ -22,6 +22,7 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
22
22
  onNavigateBack,
23
23
  onRate,
24
24
  onEdit,
25
+ onEditVideo,
25
26
  recentCreations,
26
27
  onViewAll,
27
28
  onCreationPress,
@@ -73,6 +74,7 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
73
74
  onTryAgain={onTryAgain}
74
75
  onRate={onRate}
75
76
  onEdit={onEdit}
77
+ onEditVideo={onEditVideo}
76
78
  saveButtonText={translations.saveButton}
77
79
  shareButtonText={translations.shareButton}
78
80
  tryAgainButtonText={translations.tryAnother}
@@ -46,4 +46,6 @@ export interface ResultActionBarProps {
46
46
  showRating?: boolean;
47
47
  /** Edit button callback — only shown in iconOnly mode when provided */
48
48
  onEdit?: () => void;
49
+ /** Edit video button callback — only shown in iconOnly mode when provided */
50
+ onEditVideo?: () => void;
49
51
  }
@@ -24,6 +24,8 @@ export interface ResultPreviewScreenProps {
24
24
  onRate?: () => void;
25
25
  /** Edit callback — opens photo editor for the result image */
26
26
  onEdit?: () => void;
27
+ /** Edit video callback — opens video editor for the result video */
28
+ onEditVideo?: () => void;
27
29
  /** Recent creations to display */
28
30
  recentCreations?: readonly RecentCreation[];
29
31
  /** Navigate to all creations */
package/README.md DELETED
@@ -1,316 +0,0 @@
1
- # @umituz/react-native-ai-generation-content
2
-
3
- > Provider-agnostic AI generation orchestration for React Native
4
-
5
- Comprehensive React Native library for AI-powered content generation. Support multiple providers with 25+ AI features including image generation, video creation, text-to-speech, face swap, and more.
6
-
7
- ## 🎯 Library Purpose
8
-
9
- Provider-agnostic AI generation orchestration layer. Focus on business logic and user experience while handling multiple AI providers seamlessly. Clean architecture with domain-driven design for maintainable, scalable AI features.
10
-
11
- ---
12
-
13
- ## 📋 Feature Overview
14
-
15
- ### Image Generation
16
- - **Text to Image**: Generate images from descriptions
17
- - **Image to Image**: Transform images with prompts
18
- - **Style Transfer**: Apply artistic styles
19
- - **Photo Restoration**: Restore old photos
20
- - **Upscaling**: Increase resolution
21
- - **HD Touch Up**: Enhance quality
22
-
23
- ### Face & Person Features
24
- - **Face Swap**: Swap faces between images
25
- - **Future Prediction**: Individual future scenarios
26
-
27
- ### Video & Animation
28
- - **Text to Video**: Generate videos from text
29
- - **Image to Video**: Convert images to video
30
-
31
- ### Background & Editing
32
- - **Remove Background**: Remove image backgrounds
33
- - **Replace Background**: Replace with new background
34
- - **Inpainting**: Fill masked areas
35
- - **Remove Object**: Remove unwanted objects
36
- - **Colorization**: Add color to B&W photos
37
-
38
- ### Creative & Audio
39
- - **Meme Generator**: Create memes with text
40
- - **Sketch to Image**: Convert sketches to images
41
- - **Anime Selfie**: Anime style conversion
42
- - **Audio Generation**: Generate audio content
43
- - **Text to Voice**: Text-to-speech synthesis
44
- - **Script Generator**: Generate content scripts
45
-
46
- ### Analysis
47
- - **Image Captioning**: Generate image descriptions
48
-
49
- ---
50
-
51
- ## 📦 Installation
52
-
53
- ```bash
54
- npm install @umituz/react-native-ai-generation-content
55
- ```
56
-
57
- ## 🚀 Quick Start
58
-
59
- ### Configuration
60
-
61
- ```typescript
62
- import { configureAppServices } from '@umituz/react-native-ai-generation-content';
63
-
64
- configureAppServices({
65
- networkService: {
66
- baseUrl: 'https://your-api.com',
67
- apiKey: 'your-api-key',
68
- },
69
- creditService: {
70
- checkCredits: async (userId, cost) => true,
71
- deductCredits: async (userId, cost) => {},
72
- },
73
- paywallService: {
74
- showPaywall: async () => true,
75
- },
76
- });
77
- ```
78
-
79
- ### Basic Usage
80
-
81
- ```typescript
82
- import { useTextToImageFeature } from '@umituz/react-native-ai-generation-content';
83
-
84
- const feature = useTextToImageFeature({
85
- config: {
86
- model: 'imagen-3',
87
- onProcessingComplete: (result) => {
88
- console.log('Generated:', result.imageUrl);
89
- },
90
- },
91
- userId: 'user-123',
92
- });
93
-
94
- // Use feature.state, feature.generate(), etc.
95
- ```
96
-
97
- ---
98
-
99
- ## ⚠️ Critical Rules
100
-
101
- ### MUST FOLLOW
102
-
103
- 1. **Configuration**
104
- - MUST configure app services before using features
105
- - MUST provide valid userId for tracking
106
- - MUST implement credit checking
107
- - MUST handle errors properly
108
-
109
- 2. **State Management**
110
- - MUST check isReady before enabling actions
111
- - MUST handle isProcessing state
112
- - MUST display progress to users
113
- - MUST implement error handling
114
-
115
- 3. **Performance**
116
- - MUST implement debouncing (300ms)
117
- - MUST cache results locally
118
- - MUST handle large files properly
119
- - MUST NOT block main thread
120
-
121
- 4. **Privacy & Ethics**
122
- - MUST obtain consent for person-based features
123
- - MUST implement content moderation
124
- - MUST comply with regulations
125
- - MUST provide clear usage terms
126
-
127
- ---
128
-
129
- ## 🚫 Prohibitions
130
-
131
- ### MUST AVOID
132
-
133
- ❌ **NEVER**:
134
- - Skip configuration
135
- - Use without userId
136
- - Ignore error handling
137
- - Process without user action
138
- - Violate privacy/consent
139
- - Block main thread
140
- - Hardcode API keys
141
-
142
- ---
143
-
144
- ## 🤖 AI Agent Directions
145
-
146
- When implementing with AI code generation:
147
-
148
- ```
149
- REQUIREMENTS:
150
- 1. Import from @umituz/react-native-ai-generation-content
151
- 2. Configure app services first
152
- 3. Use feature-specific hooks
153
- 4. Implement proper state management
154
- 5. Handle errors gracefully
155
- 6. Show progress to users
156
- 7. Implement cleanup on unmount
157
-
158
- CRITICAL RULES:
159
- - MUST configure before using features
160
- - MUST provide valid userId
161
- - MUST check isReady before actions
162
- - MUST handle isProcessing state
163
- - MUST implement error handling
164
- - MUST respect user privacy
165
-
166
- FEATURE HOOKS:
167
- - useTextToImageFeature: Image generation
168
- - useFaceSwapFeature: Face swapping
169
- - useTextToVoiceFeature: Text-to-speech
170
- - And 20+ more features
171
-
172
- STRICTLY FORBIDDEN:
173
- - No skipping configuration
174
- - No missing userId
175
- - No ignoring errors
176
- - No auto-processing
177
- - No privacy violations
178
- - No blocked UI
179
- - No hardcoded credentials
180
- ```
181
-
182
- ---
183
-
184
- ## 📚 Documentation Structure
185
-
186
- ```
187
- @umituz/react-native-ai-generation-content/
188
- ├── src/
189
- │ ├── features/ # 23 AI features (each with README)
190
- │ │ ├── text-to-image/
191
- │ │ ├── face-swap/
192
- │ │ └── ...
193
- │ ├── domains/ # Shared domains
194
- │ │ ├── content-moderation/
195
- │ │ ├── prompts/
196
- │ │ ├── creations/
197
- │ │ └── face-detection/
198
- │ └── features/shared/ # Shared functionality
199
- ├── docs/ # Additional documentation
200
- ├── ARCHITECTURE.md # Architecture details
201
- ├── FAQ.md # Common questions
202
- └── MIGRATION_GUIDE.md # Migration guide
203
- ```
204
-
205
- ### Feature Documentation
206
-
207
- Each feature has comprehensive documentation:
208
- - **Import paths** (only code in README)
209
- - **Usage strategy** (when to use/not use)
210
- - **Critical rules** (MUST follow)
211
- - **Prohibitions** (MUST avoid)
212
- - **AI agent directions** (prompt templates)
213
- - **Configuration strategy**
214
- - **State management**
215
- - **Best practices**
216
- - **Common pitfalls**
217
-
218
- **Example**: See `src/features/text-to-image/README.md`
219
-
220
- ---
221
-
222
- ## 🎨 Architecture
223
-
224
- ### Clean Architecture
225
-
226
- ```
227
- ┌─────────────────────────────┐
228
- │ Presentation Layer │
229
- │ (Components, Hooks) │
230
- └─────────────────────────────┘
231
-
232
- ┌─────────────────────────────┐
233
- │ Domain Layer │
234
- │ (Types, Interfaces) │
235
- └─────────────────────────────┘
236
-
237
- ┌─────────────────────────────┐
238
- │ Infrastructure Layer │
239
- │ (Services, Repositories) │
240
- └─────────────────────────────┘
241
- ```
242
-
243
- ### Key Principles
244
-
245
- - **Separation of Concerns**: Each layer has specific responsibility
246
- - **Dependency Inversion**: Depend on abstractions, not implementations
247
- - **Provider Agnostic**: Support multiple AI providers
248
- - **Type Safety**: Comprehensive TypeScript types
249
- - **Testability**: Clean, testable code
250
-
251
- ---
252
-
253
- ## 🔐 Security & Privacy
254
-
255
- ### API Keys
256
- - Never store in code
257
- - Use environment variables
258
- - Implement rotation
259
-
260
- ### Content Moderation
261
- - Enable for user-generated content
262
- - Configure rules appropriately
263
- - Monitor for violations
264
-
265
- ### User Data
266
- - Anonymize analytics
267
- - Secure storage
268
- - GDPR/CCPA compliance
269
-
270
- ---
271
-
272
- ## 📈 Performance
273
-
274
- ### Optimization
275
- - Lazy load features
276
- - Cache results
277
- - Optimize images
278
- - Background processing
279
-
280
- ### Best Practices
281
- - Implement debouncing
282
- - Use pagination
283
- - Compress uploads
284
- - Monitor performance
285
-
286
- ---
287
-
288
- ## 🤝 Contributing
289
-
290
- Contributions welcome! Please:
291
- - Follow code style
292
- - Add tests
293
- - Update docs
294
- - Submit PR
295
-
296
- See [CONTRIBUTING.md](CONTRIBUTING.md)
297
-
298
- ---
299
-
300
- ## 📄 License
301
-
302
- MIT
303
-
304
- ---
305
-
306
- ## 📞 Support
307
-
308
- - **Issues**: GitHub Issues
309
- - **Docs**: `/docs` folder
310
- - **FAQ**: [FAQ.md](FAQ.md)
311
- - **Migration**: [MIGRATION_GUIDE.md](MIGRATION_GUIDE.md)
312
-
313
- ---
314
-
315
- **Version**: 2.0.0 (Strategy-based Documentation)
316
- **Last Updated**: 2025-01-08