@umituz/react-native-ai-generation-content 1.89.23 → 1.89.25

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.89.23",
3
+ "version": "1.89.25",
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",
@@ -59,7 +59,7 @@ export function useGalleryState(options: GalleryStateOptions): GalleryStateRetur
59
59
  [selectedCreation]
60
60
  );
61
61
 
62
- return {
62
+ return useMemo(() => ({
63
63
  selectedCreation,
64
64
  showRatingPicker,
65
65
  selectedImageUrl,
@@ -68,5 +68,12 @@ export function useGalleryState(options: GalleryStateOptions): GalleryStateRetur
68
68
  showPreview,
69
69
  setSelectedCreation,
70
70
  setShowRatingPicker,
71
- };
71
+ }), [
72
+ selectedCreation,
73
+ showRatingPicker,
74
+ selectedImageUrl,
75
+ selectedVideoUrl,
76
+ hasMediaToShow,
77
+ showPreview,
78
+ ]);
72
79
  }
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo, useCallback, useState } from "react";
2
2
  import { View, FlatList } from "react-native";
3
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
3
4
  import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
4
5
  import { FilterSheet, useAppFocusEffect } from "@umituz/react-native-design-system/molecules";
5
6
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
@@ -37,6 +38,7 @@ export function CreationsGalleryScreen({
37
38
  onShareToFeed,
38
39
  }: CreationsGalleryScreenProps) {
39
40
  const tokens = useAppDesignTokens();
41
+ const insets = useSafeAreaInsets();
40
42
  const [viewMode, setViewMode] = useState<"list" | "grid">("list");
41
43
 
42
44
  const { data: creations, isLoading, refetch } = useCreations({ userId, repository });
@@ -76,9 +78,10 @@ export function CreationsGalleryScreen({
76
78
  void refetch();
77
79
  // Reset selection on focus if no initial ID is being enforced
78
80
  if (!initialCreationId) {
79
- galleryState.setSelectedCreation(null);
81
+ const { setSelectedCreation } = galleryState;
82
+ setSelectedCreation(null);
80
83
  }
81
- }, [refetch, initialCreationId, galleryState]));
84
+ }, [refetch, initialCreationId, galleryState.setSelectedCreation]));
82
85
 
83
86
  const filterButtons = useMemo(() =>
84
87
  createFilterButtons({
@@ -157,7 +160,14 @@ export function CreationsGalleryScreen({
157
160
  if (!creations?.length && !isLoading) return null;
158
161
  if (isLoading) return null;
159
162
  return (
160
- <View style={[styles.header, { backgroundColor: tokens.colors.surface, borderBottomColor: tokens.colors.border }]}>
163
+ <View style={[
164
+ styles.header,
165
+ {
166
+ backgroundColor: tokens.colors.surface,
167
+ borderBottomColor: tokens.colors.border,
168
+ paddingTop: hasScreenHeader ? 0 : insets.top
169
+ }
170
+ ]}>
161
171
  <GalleryHeader
162
172
  title={hasScreenHeader ? "" : t(config.translations.title)}
163
173
  count={filters.filtered.length}
@@ -216,7 +226,7 @@ export function CreationsGalleryScreen({
216
226
  }
217
227
 
218
228
  return (
219
- <ScreenLayout header={screenHeader} scrollable={false}>
229
+ <ScreenLayout header={screenHeader} scrollable={false} edges={["left", "right", "bottom"]}>
220
230
  {renderHeader}
221
231
  {filters.filtered.length === 0 ? (
222
232
  <View style={[styles.listContent, styles.emptyContent]}>
@@ -75,68 +75,52 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
75
75
  if (iconOnly) {
76
76
  return (
77
77
  <View style={styles.container}>
78
- <TouchableOpacity
79
- style={[styles.iconButton, isSaving && styles.disabledButton]}
80
- onPress={onDownload}
81
- disabled={isSaving}
82
- activeOpacity={0.7}
83
- >
84
- {isSaving ? (
85
- <ActivityIndicator color={tokens.colors.textInverse} size="small" />
86
- ) : (
87
- <AtomicIcon name="download-outline" customSize={20} color="onPrimary" />
88
- )}
89
- </TouchableOpacity>
90
- <TouchableOpacity
91
- style={[styles.iconButton, isSharing && styles.disabledButton]}
92
- onPress={onShare}
93
- disabled={isSharing}
94
- activeOpacity={0.7}
95
- >
96
- {isSharing ? (
97
- <ActivityIndicator color={tokens.colors.textInverse} size="small" />
98
- ) : (
99
- <AtomicIcon name="share-social-outline" customSize={20} color="onPrimary" />
100
- )}
101
- </TouchableOpacity>
102
- {showTryAgain && onTryAgain && (
78
+ {onDownload && (
103
79
  <TouchableOpacity
104
- style={styles.iconButton}
105
- onPress={onTryAgain}
80
+ style={[styles.iconButton, isSaving && styles.disabledButton]}
81
+ onPress={onDownload}
82
+ disabled={isSaving}
106
83
  activeOpacity={0.7}
107
84
  >
108
- <AtomicIcon name="refresh-outline" customSize={20} color="onPrimary" />
85
+ {isSaving ? (
86
+ <ActivityIndicator color={tokens.colors.textInverse} size="small" />
87
+ ) : (
88
+ <AtomicIcon name="download-outline" customSize={20} color="onPrimary" />
89
+ )}
109
90
  </TouchableOpacity>
110
91
  )}
111
- {showRating && onRate && (
92
+ {onShare && (
112
93
  <TouchableOpacity
113
- style={styles.iconButton}
114
- onPress={onRate}
94
+ style={[styles.iconButton, isSharing && styles.disabledButton]}
95
+ onPress={onShare}
96
+ disabled={isSharing}
115
97
  activeOpacity={0.7}
116
98
  >
117
- <AtomicIcon name="star-outline" customSize={20} color="onPrimary" />
99
+ {isSharing ? (
100
+ <ActivityIndicator color={tokens.colors.textInverse} size="small" />
101
+ ) : (
102
+ <AtomicIcon name="share-social-outline" customSize={20} color="onPrimary" />
103
+ )}
118
104
  </TouchableOpacity>
119
105
  )}
120
- {/* Photo & Video editing - Disabled for now
121
- {onEdit && (
106
+ {showTryAgain && onTryAgain && (
122
107
  <TouchableOpacity
123
108
  style={styles.iconButton}
124
- onPress={onEdit}
109
+ onPress={onTryAgain}
125
110
  activeOpacity={0.7}
126
111
  >
127
- <AtomicIcon name="edit" customSize={20} color="onPrimary" />
112
+ <AtomicIcon name="refresh-outline" customSize={20} color="onPrimary" />
128
113
  </TouchableOpacity>
129
114
  )}
130
- {onEditVideo && (
115
+ {showRating && onRate && (
131
116
  <TouchableOpacity
132
117
  style={styles.iconButton}
133
- onPress={onEditVideo}
118
+ onPress={onRate}
134
119
  activeOpacity={0.7}
135
120
  >
136
- <AtomicIcon name="video" customSize={20} color="onPrimary" />
121
+ <AtomicIcon name="star-outline" customSize={20} color="onPrimary" />
137
122
  </TouchableOpacity>
138
123
  )}
139
- */}
140
124
  {onShareToFeed && (
141
125
  <TouchableOpacity
142
126
  style={styles.iconButton}
@@ -152,33 +136,37 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
152
136
 
153
137
  return (
154
138
  <View style={styles.container}>
155
- <TouchableOpacity
156
- style={styles.button}
157
- onPress={onDownload}
158
- disabled={isSaving}
159
- activeOpacity={0.7}
160
- >
161
- {isSaving ? (
162
- <ActivityIndicator color={tokens.colors.textInverse} size="small" />
163
- ) : (
164
- <AtomicIcon name="download-outline" customSize={18} color="onPrimary" />
165
- )}
166
- <AtomicText style={styles.buttonText}>{saveButtonText}</AtomicText>
167
- </TouchableOpacity>
168
- <TouchableOpacity
169
- style={styles.button}
170
- onPress={onShare}
171
- disabled={isSharing}
172
- activeOpacity={0.7}
173
- >
174
- {isSharing ? (
175
- <ActivityIndicator color={tokens.colors.textInverse} size="small" />
176
- ) : (
177
- <AtomicIcon name="share-social-outline" customSize={18} color="onPrimary" />
178
- )}
179
- <AtomicText style={styles.buttonText}>{shareButtonText}</AtomicText>
180
- </TouchableOpacity>
181
- {showTryAgain && (
139
+ {onDownload && (
140
+ <TouchableOpacity
141
+ style={styles.button}
142
+ onPress={onDownload}
143
+ disabled={isSaving}
144
+ activeOpacity={0.7}
145
+ >
146
+ {isSaving ? (
147
+ <ActivityIndicator color={tokens.colors.textInverse} size="small" />
148
+ ) : (
149
+ <AtomicIcon name="download-outline" customSize={18} color="onPrimary" />
150
+ )}
151
+ <AtomicText style={styles.buttonText}>{saveButtonText}</AtomicText>
152
+ </TouchableOpacity>
153
+ )}
154
+ {onShare && (
155
+ <TouchableOpacity
156
+ style={styles.button}
157
+ onPress={onShare}
158
+ disabled={isSharing}
159
+ activeOpacity={0.7}
160
+ >
161
+ {isSharing ? (
162
+ <ActivityIndicator color={tokens.colors.textInverse} size="small" />
163
+ ) : (
164
+ <AtomicIcon name="share-social-outline" customSize={18} color="onPrimary" />
165
+ )}
166
+ <AtomicText style={styles.buttonText}>{shareButtonText}</AtomicText>
167
+ </TouchableOpacity>
168
+ )}
169
+ {showTryAgain && onTryAgain && (
182
170
  <TouchableOpacity style={styles.button} onPress={onTryAgain} activeOpacity={0.7}>
183
171
  <AtomicIcon name="refresh-outline" customSize={18} color="onPrimary" />
184
172
  <AtomicText style={styles.buttonText}>{tryAgainButtonText}</AtomicText>
@@ -25,9 +25,9 @@ export interface ResultActionBarProps {
25
25
  /** Currently sharing */
26
26
  isSharing: boolean;
27
27
  /** Download callback */
28
- onDownload: () => void;
28
+ onDownload?: () => void;
29
29
  /** Share callback */
30
- onShare: () => void;
30
+ onShare?: () => void;
31
31
  /** Try again callback */
32
32
  onTryAgain?: () => void;
33
33
  /** Rate callback */