@umituz/react-native-ai-generation-content 1.83.93 → 1.83.95

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.93",
3
+ "version": "1.83.95",
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,6 +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 on an image creation. */
27
+ readonly onEdit?: (imageUrl: string) => void;
28
+ /** Called when the user taps Edit on a video creation. */
29
+ readonly onEditVideo?: (videoUrl: string) => void;
26
30
  }
27
31
 
28
32
  export function GalleryResultPreview({
@@ -37,6 +41,8 @@ export function GalleryResultPreview({
37
41
  onRate,
38
42
  onSubmitRating,
39
43
  onCloseRating,
44
+ onEdit,
45
+ onEditVideo,
40
46
  }: GalleryResultPreviewProps) {
41
47
  const alert = useAlert();
42
48
 
@@ -61,6 +67,8 @@ export function GalleryResultPreview({
61
67
  onTryAgain={onTryAgain}
62
68
  onNavigateBack={onBack}
63
69
  onRate={onRate}
70
+ onEdit={!videoUrl && imageUrl && onEdit ? () => onEdit(imageUrl) : undefined}
71
+ onEditVideo={videoUrl && onEditVideo ? () => onEditVideo(videoUrl) : undefined}
64
72
  hideLabel
65
73
  iconOnly
66
74
  showTryAgain
@@ -32,6 +32,8 @@ export function CreationsGalleryScreen({
32
32
  onTryAgain,
33
33
  getCreationTitle,
34
34
  onCreationPress,
35
+ onEdit,
36
+ onEditVideo,
35
37
  }: CreationsGalleryScreenProps) {
36
38
  const tokens = useAppDesignTokens();
37
39
  const [viewMode, setViewMode] = useState<"list" | "grid">("list");
@@ -182,6 +184,8 @@ export function CreationsGalleryScreen({
182
184
  onRate={callbacks.handleOpenRatingPicker}
183
185
  onSubmitRating={callbacks.handleSubmitRating}
184
186
  onCloseRating={() => galleryState.setShowRatingPicker(false)}
187
+ onEdit={onEdit}
188
+ onEditVideo={onEditVideo}
185
189
  />
186
190
  );
187
191
  }
@@ -22,4 +22,8 @@ export interface CreationsGalleryScreenProps {
22
22
  readonly getCreationTitle?: (creation: { type: string; metadata?: Record<string, unknown> }) => string;
23
23
  /** Custom handler when a creation card is pressed. When provided, overrides the built-in preview. */
24
24
  readonly onCreationPress?: (creation: { id: string; uri: string; type: string; originalUri?: string; output?: { imageUrl?: string; videoUrl?: string }; metadata?: Record<string, unknown> }) => void;
25
+ /** Called when the user taps the Edit button in the creation detail view. Receives the image URL. Only shown for image creations. */
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;
25
29
  }
@@ -23,6 +23,8 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
23
23
  iconOnly = false,
24
24
  showTryAgain = true,
25
25
  showRating = false,
26
+ onEdit,
27
+ onEditVideo,
26
28
  }) => {
27
29
  const tokens = useAppDesignTokens();
28
30
  const { minTouchTarget } = useResponsive();
@@ -114,6 +116,24 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
114
116
  <AtomicIcon name="star-outline" customSize={20} color="onPrimary" />
115
117
  </TouchableOpacity>
116
118
  )}
119
+ {onEdit && (
120
+ <TouchableOpacity
121
+ style={styles.iconButton}
122
+ onPress={onEdit}
123
+ activeOpacity={0.7}
124
+ >
125
+ <AtomicIcon name="edit" customSize={20} color="onPrimary" />
126
+ </TouchableOpacity>
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
+ )}
117
137
  </View>
118
138
  );
119
139
  }
@@ -21,6 +21,8 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
21
21
  onTryAgain,
22
22
  onNavigateBack,
23
23
  onRate,
24
+ onEdit,
25
+ onEditVideo,
24
26
  recentCreations,
25
27
  onViewAll,
26
28
  onCreationPress,
@@ -71,6 +73,8 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
71
73
  onShare={onShare}
72
74
  onTryAgain={onTryAgain}
73
75
  onRate={onRate}
76
+ onEdit={onEdit}
77
+ onEditVideo={onEditVideo}
74
78
  saveButtonText={translations.saveButton}
75
79
  shareButtonText={translations.shareButton}
76
80
  tryAgainButtonText={translations.tryAnother}
@@ -44,4 +44,8 @@ export interface ResultActionBarProps {
44
44
  showTryAgain?: boolean;
45
45
  /** Show rating button */
46
46
  showRating?: boolean;
47
+ /** Edit button callback — only shown in iconOnly mode when provided */
48
+ onEdit?: () => void;
49
+ /** Edit video button callback — only shown in iconOnly mode when provided */
50
+ onEditVideo?: () => void;
47
51
  }
@@ -22,6 +22,10 @@ export interface ResultPreviewScreenProps {
22
22
  onTryAgain: () => void;
23
23
  onNavigateBack: () => void;
24
24
  onRate?: () => void;
25
+ /** Edit callback — opens photo editor for the result image */
26
+ onEdit?: () => void;
27
+ /** Edit video callback — opens video editor for the result video */
28
+ onEditVideo?: () => void;
25
29
  /** Recent creations to display */
26
30
  recentCreations?: readonly RecentCreation[];
27
31
  /** Navigate to all creations */