@umituz/react-native-ai-generation-content 1.84.2 → 1.84.4

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.84.2",
3
+ "version": "1.84.4",
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",
@@ -27,6 +27,8 @@ interface GalleryResultPreviewProps {
27
27
  readonly onEdit?: (imageUrl: string) => void;
28
28
  /** Called when the user taps Edit on a video creation. */
29
29
  readonly onEditVideo?: (videoUrl: string) => void;
30
+ /** Called when the user taps Post to Feed. Omit to hide (apps without a feed). */
31
+ readonly onShareToFeed?: (creation: Creation) => void;
30
32
  }
31
33
 
32
34
  export function GalleryResultPreview({
@@ -43,6 +45,7 @@ export function GalleryResultPreview({
43
45
  onCloseRating,
44
46
  onEdit,
45
47
  onEditVideo,
48
+ onShareToFeed,
46
49
  }: GalleryResultPreviewProps) {
47
50
  const alert = useAlert();
48
51
 
@@ -69,6 +72,7 @@ export function GalleryResultPreview({
69
72
  onRate={onRate}
70
73
  onEdit={!videoUrl && imageUrl && onEdit ? () => onEdit(imageUrl) : undefined}
71
74
  onEditVideo={videoUrl && onEditVideo ? () => onEditVideo(videoUrl) : undefined}
75
+ onShareToFeed={onShareToFeed ? () => onShareToFeed(selectedCreation) : undefined}
72
76
  hideLabel
73
77
  iconOnly
74
78
  showTryAgain
@@ -34,6 +34,7 @@ export function CreationsGalleryScreen({
34
34
  onCreationPress,
35
35
  onEdit,
36
36
  onEditVideo,
37
+ onShareToFeed,
37
38
  }: CreationsGalleryScreenProps) {
38
39
  const tokens = useAppDesignTokens();
39
40
  const [viewMode, setViewMode] = useState<"list" | "grid">("list");
@@ -97,15 +98,17 @@ export function CreationsGalleryScreen({
97
98
  onShare: async () => callbacks.handleShareCard(item),
98
99
  onDelete: () => callbacks.handleDelete(item),
99
100
  onFavorite: () => callbacks.handleFavorite(item),
100
- }), [callbacks, onCreationPress]);
101
+ onPostToFeed: onShareToFeed ? () => onShareToFeed(item) : undefined,
102
+ }), [callbacks, onCreationPress, onShareToFeed]);
101
103
 
102
104
  const renderItem = useCallback(({ item }: { item: Creation }) => (
103
105
  <CreationCard
104
106
  creation={item}
105
107
  titleText={getItemTitle(item)}
106
108
  callbacks={getItemCallbacks(item)}
109
+ canPostToFeed={!!onShareToFeed && item.status === "completed"}
107
110
  />
108
- ), [getItemTitle, getItemCallbacks]);
111
+ ), [getItemTitle, getItemCallbacks, onShareToFeed]);
109
112
 
110
113
  const renderGridItems = useCallback((items: Creation[]) => {
111
114
  const rows: Array<{ left: Creation; right: Creation | null }> = [];
@@ -186,6 +189,7 @@ export function CreationsGalleryScreen({
186
189
  onCloseRating={() => galleryState.setShowRatingPicker(false)}
187
190
  onEdit={onEdit}
188
191
  onEditVideo={onEditVideo}
192
+ onShareToFeed={onShareToFeed}
189
193
  />
190
194
  );
191
195
  }
@@ -2,6 +2,7 @@
2
2
  * Creations Gallery Screen Types
3
3
  */
4
4
 
5
+ import type { Creation } from "../../domain/entities/Creation";
5
6
  import type { CreationsConfig } from "../../domain/value-objects/CreationsConfig";
6
7
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
7
8
 
@@ -26,4 +27,6 @@ export interface CreationsGalleryScreenProps {
26
27
  readonly onEdit?: (imageUrl: string) => void;
27
28
  /** Called when the user taps the Edit button in the creation detail view. Receives the video URL. Only shown for video creations. */
28
29
  readonly onEditVideo?: (videoUrl: string) => void;
30
+ /** Called when the user taps the "Post to Feed" button on a creation card. Shows a filled send icon. */
31
+ readonly onShareToFeed?: (creation: Creation) => void;
29
32
  }
@@ -25,6 +25,7 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
25
25
  showRating = false,
26
26
  onEdit,
27
27
  onEditVideo,
28
+ onShareToFeed,
28
29
  }) => {
29
30
  const tokens = useAppDesignTokens();
30
31
  const { minTouchTarget } = useResponsive();
@@ -134,6 +135,15 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
134
135
  <AtomicIcon name="video" customSize={20} color="onPrimary" />
135
136
  </TouchableOpacity>
136
137
  )}
138
+ {onShareToFeed && (
139
+ <TouchableOpacity
140
+ style={styles.iconButton}
141
+ onPress={onShareToFeed}
142
+ activeOpacity={0.7}
143
+ >
144
+ <AtomicIcon name="send" customSize={20} color="onPrimary" />
145
+ </TouchableOpacity>
146
+ )}
137
147
  </View>
138
148
  );
139
149
  }
@@ -23,6 +23,7 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
23
23
  onRate,
24
24
  onEdit,
25
25
  onEditVideo,
26
+ onShareToFeed,
26
27
  recentCreations,
27
28
  onViewAll,
28
29
  onCreationPress,
@@ -75,6 +76,7 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
75
76
  onRate={onRate}
76
77
  onEdit={onEdit}
77
78
  onEditVideo={onEditVideo}
79
+ onShareToFeed={onShareToFeed}
78
80
  saveButtonText={translations.saveButton}
79
81
  shareButtonText={translations.shareButton}
80
82
  tryAgainButtonText={translations.tryAnother}
@@ -48,4 +48,6 @@ export interface ResultActionBarProps {
48
48
  onEdit?: () => void;
49
49
  /** Edit video button callback — only shown in iconOnly mode when provided */
50
50
  onEditVideo?: () => void;
51
+ /** Post to feed callback — when provided, shows a "send" button. Omit to hide (apps without a feed). */
52
+ onShareToFeed?: () => void;
51
53
  }
@@ -26,6 +26,8 @@ export interface ResultPreviewScreenProps {
26
26
  onEdit?: () => void;
27
27
  /** Edit video callback — opens video editor for the result video */
28
28
  onEditVideo?: () => void;
29
+ /** Post to feed callback — when provided, shows a send button. Omit to hide (apps without a feed). */
30
+ onShareToFeed?: () => void;
29
31
  /** Recent creations to display */
30
32
  recentCreations?: readonly RecentCreation[];
31
33
  /** Navigate to all creations */