@umituz/react-native-ai-generation-content 1.12.12 → 1.12.15
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 +1 -1
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +1 -0
- package/src/domains/creations/presentation/components/CreationCard.tsx +15 -20
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +26 -18
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +23 -12
package/package.json
CHANGED
|
@@ -52,6 +52,7 @@ export interface CreationsConfig {
|
|
|
52
52
|
readonly gridColumns?: number;
|
|
53
53
|
readonly pathBuilder?: PathBuilder;
|
|
54
54
|
readonly documentMapper?: DocumentMapper;
|
|
55
|
+
readonly enableFiltering?: boolean;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export const DEFAULT_TRANSLATIONS: CreationsTranslations = {
|
|
@@ -91,17 +91,7 @@ export function CreationCard({
|
|
|
91
91
|
width: 100,
|
|
92
92
|
height: 100,
|
|
93
93
|
},
|
|
94
|
-
|
|
95
|
-
position: "absolute",
|
|
96
|
-
top: 4,
|
|
97
|
-
right: 4,
|
|
98
|
-
width: 28,
|
|
99
|
-
height: 28,
|
|
100
|
-
borderRadius: 14,
|
|
101
|
-
backgroundColor: "rgba(255,255,255,0.7)",
|
|
102
|
-
justifyContent: "center",
|
|
103
|
-
alignItems: "center",
|
|
104
|
-
},
|
|
94
|
+
|
|
105
95
|
selectionOverlay: {
|
|
106
96
|
position: "absolute",
|
|
107
97
|
top: 4,
|
|
@@ -167,15 +157,6 @@ export function CreationCard({
|
|
|
167
157
|
{isSelected && <AtomicIcon name="checkmark-circle" size="xs" color="white" />}
|
|
168
158
|
</View>
|
|
169
159
|
)}
|
|
170
|
-
{!isSelectionMode && onToggleFavorite && (
|
|
171
|
-
<TouchableOpacity style={styles.favoriteBtn} onPress={handleToggleFavorite}>
|
|
172
|
-
<AtomicIcon
|
|
173
|
-
name={creation.isFavorite ? "heart" : "heart-outline"}
|
|
174
|
-
size="xs"
|
|
175
|
-
color={creation.isFavorite ? "error" : "secondary"}
|
|
176
|
-
/>
|
|
177
|
-
</TouchableOpacity>
|
|
178
|
-
)}
|
|
179
160
|
</View>
|
|
180
161
|
<View style={styles.content}>
|
|
181
162
|
<View>
|
|
@@ -187,6 +168,20 @@ export function CreationCard({
|
|
|
187
168
|
</View>
|
|
188
169
|
{!isSelectionMode && (
|
|
189
170
|
<View style={styles.actions}>
|
|
171
|
+
{onView && (
|
|
172
|
+
<TouchableOpacity style={styles.actionBtn} onPress={handleView}>
|
|
173
|
+
<AtomicIcon name="eye" size="sm" color="primary" />
|
|
174
|
+
</TouchableOpacity>
|
|
175
|
+
)}
|
|
176
|
+
{onToggleFavorite && (
|
|
177
|
+
<TouchableOpacity style={styles.actionBtn} onPress={handleToggleFavorite}>
|
|
178
|
+
<AtomicIcon
|
|
179
|
+
name={creation.isFavorite ? "heart" : "heart-outline"}
|
|
180
|
+
size="sm"
|
|
181
|
+
color={creation.isFavorite ? "error" : "primary"}
|
|
182
|
+
/>
|
|
183
|
+
</TouchableOpacity>
|
|
184
|
+
)}
|
|
190
185
|
<TouchableOpacity style={styles.actionBtn} onPress={handleShare}>
|
|
191
186
|
<AtomicIcon name="share-social" size="sm" color="primary" />
|
|
192
187
|
</TouchableOpacity>
|
|
@@ -13,6 +13,9 @@ interface GalleryHeaderProps {
|
|
|
13
13
|
readonly onFavoritesPress?: () => void;
|
|
14
14
|
readonly showOnlyFavorites?: boolean;
|
|
15
15
|
readonly style?: any;
|
|
16
|
+
readonly subtitle?: string;
|
|
17
|
+
readonly isFilterEnabled?: boolean;
|
|
18
|
+
readonly showCount?: boolean;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
@@ -25,6 +28,9 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
25
28
|
filterIcon = 'filter-outline',
|
|
26
29
|
onFavoritesPress,
|
|
27
30
|
showOnlyFavorites = false,
|
|
31
|
+
subtitle,
|
|
32
|
+
isFilterEnabled = true,
|
|
33
|
+
showCount = true,
|
|
28
34
|
style,
|
|
29
35
|
}) => {
|
|
30
36
|
const tokens = useAppDesignTokens();
|
|
@@ -35,7 +41,7 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
35
41
|
<View style={styles.titleArea}>
|
|
36
42
|
{!!title && <AtomicText style={styles.title}>{title}</AtomicText>}
|
|
37
43
|
<AtomicText style={styles.subtitle}>
|
|
38
|
-
{count} {countLabel}
|
|
44
|
+
{subtitle || (showCount ? `${count} ${countLabel}` : '')}
|
|
39
45
|
</AtomicText>
|
|
40
46
|
</View>
|
|
41
47
|
<View style={styles.actions}>
|
|
@@ -52,23 +58,25 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
52
58
|
/>
|
|
53
59
|
</TouchableOpacity>
|
|
54
60
|
)}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
{isFilterEnabled && (
|
|
62
|
+
<TouchableOpacity
|
|
63
|
+
onPress={onFilterPress}
|
|
64
|
+
style={[styles.filterButton, isFiltered && styles.filterButtonActive]}
|
|
65
|
+
activeOpacity={0.7}
|
|
66
|
+
>
|
|
67
|
+
<AtomicIcon
|
|
68
|
+
name={filterIcon}
|
|
69
|
+
size="sm"
|
|
70
|
+
color={isFiltered ? "primary" : "secondary"}
|
|
71
|
+
/>
|
|
72
|
+
<AtomicText style={[styles.filterText, { color: isFiltered ? tokens.colors.primary : tokens.colors.textSecondary }]}>
|
|
73
|
+
{filterLabel}
|
|
74
|
+
</AtomicText>
|
|
75
|
+
{isFiltered && (
|
|
76
|
+
<View style={styles.badge} />
|
|
77
|
+
)}
|
|
78
|
+
</TouchableOpacity>
|
|
79
|
+
)}
|
|
72
80
|
</View>
|
|
73
81
|
</View>
|
|
74
82
|
);
|
|
@@ -32,13 +32,16 @@ interface CreationsGalleryScreenProps {
|
|
|
32
32
|
readonly userId: string | null;
|
|
33
33
|
readonly repository: ICreationsRepository;
|
|
34
34
|
readonly config: CreationsConfig;
|
|
35
|
-
readonly t: (key: string) => string;
|
|
35
|
+
readonly t: (key: string, options?: any) => string;
|
|
36
36
|
readonly enableEditing?: boolean;
|
|
37
37
|
readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
|
|
38
38
|
readonly onEmptyAction?: () => void;
|
|
39
39
|
readonly emptyActionLabel?: string;
|
|
40
40
|
readonly onBackPress?: () => void;
|
|
41
41
|
readonly headerTitle?: string;
|
|
42
|
+
readonly showCount?: boolean;
|
|
43
|
+
readonly enableSearch?: boolean;
|
|
44
|
+
readonly showGalleryHeader?: boolean;
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
export function CreationsGalleryScreen({
|
|
@@ -52,6 +55,9 @@ export function CreationsGalleryScreen({
|
|
|
52
55
|
emptyActionLabel,
|
|
53
56
|
onBackPress,
|
|
54
57
|
headerTitle,
|
|
58
|
+
showCount = true,
|
|
59
|
+
enableSearch = true,
|
|
60
|
+
showGalleryHeader = true,
|
|
55
61
|
}: CreationsGalleryScreenProps) {
|
|
56
62
|
const tokens = useAppDesignTokens();
|
|
57
63
|
const { share } = useSharing();
|
|
@@ -184,7 +190,7 @@ export function CreationsGalleryScreen({
|
|
|
184
190
|
} : undefined}
|
|
185
191
|
/>
|
|
186
192
|
)}
|
|
187
|
-
{!isSelectionMode && (
|
|
193
|
+
{!isSelectionMode && enableSearch && (
|
|
188
194
|
<View style={{ paddingHorizontal: tokens.spacing.md, paddingBottom: tokens.spacing.xs }}>
|
|
189
195
|
<SearchBar
|
|
190
196
|
placeholder={t("common.search") || "Search Prompt..."}
|
|
@@ -198,16 +204,21 @@ export function CreationsGalleryScreen({
|
|
|
198
204
|
contentContainerStyle={{ paddingHorizontal: 0 }}
|
|
199
205
|
>
|
|
200
206
|
{(!creations || creations?.length === 0) && !isLoading ? null : (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
showGalleryHeader ? (
|
|
208
|
+
<GalleryHeader
|
|
209
|
+
title={showScreenHeader || isSelectionMode ? '' : screenTitle}
|
|
210
|
+
count={filtered.length}
|
|
211
|
+
countLabel=''
|
|
212
|
+
subtitle={showCount ? t(config.translations.photoCount, { count: filtered.length }) : undefined}
|
|
213
|
+
isFiltered={isFiltered}
|
|
214
|
+
filterLabel={t(config.translations.filterLabel) || 'Filter'}
|
|
215
|
+
onFilterPress={() => filterSheetRef.current?.present()}
|
|
216
|
+
onFavoritesPress={() => setShowOnlyFavorites(!showOnlyFavorites)}
|
|
217
|
+
showOnlyFavorites={showOnlyFavorites}
|
|
218
|
+
isFilterEnabled={config.enableFiltering ?? false}
|
|
219
|
+
showCount={showCount}
|
|
220
|
+
/>
|
|
221
|
+
) : null
|
|
211
222
|
)}
|
|
212
223
|
|
|
213
224
|
{/* Main Content Grid - handles empty/loading via ListEmptyComponent */}
|