@umituz/react-native-ai-generation-content 1.12.15 → 1.12.17
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.12.
|
|
3
|
+
"version": "1.12.17",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
81
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
2
4
|
import { ImageGallery } from "@umituz/react-native-image";
|
|
5
|
+
import { AtomicIcon, AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
3
6
|
import type { Creation } from "../../domain/entities/Creation";
|
|
4
7
|
|
|
5
8
|
interface CreationImageViewerProps {
|
|
@@ -23,12 +26,66 @@ export const CreationImageViewer: React.FC<CreationImageViewerProps> = ({
|
|
|
23
26
|
onImageEdit,
|
|
24
27
|
selectedCreationId,
|
|
25
28
|
}) => {
|
|
29
|
+
const tokens = useAppDesignTokens();
|
|
30
|
+
const insets = useSafeAreaInsets();
|
|
31
|
+
|
|
26
32
|
const handleImageChange = async (uri: string) => {
|
|
27
33
|
if (selectedCreationId && onImageEdit) {
|
|
28
34
|
await onImageEdit(uri, selectedCreationId);
|
|
29
35
|
}
|
|
30
36
|
};
|
|
31
37
|
|
|
38
|
+
const HeaderComponent = ({ imageIndex }: { imageIndex: number }) => (
|
|
39
|
+
<View style={[styles.header, { paddingTop: Math.max(insets.top, tokens.spacing.sm) }]} pointerEvents="box-none">
|
|
40
|
+
<View style={styles.counter}>
|
|
41
|
+
<AtomicText style={styles.counterText}>
|
|
42
|
+
{imageIndex + 1} / {creations.length}
|
|
43
|
+
</AtomicText>
|
|
44
|
+
</View>
|
|
45
|
+
<TouchableOpacity
|
|
46
|
+
onPress={onDismiss}
|
|
47
|
+
style={styles.closeButton}
|
|
48
|
+
activeOpacity={0.7}
|
|
49
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
50
|
+
>
|
|
51
|
+
<AtomicIcon name="close" size="lg" color="white" />
|
|
52
|
+
</TouchableOpacity>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
header: {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: 0,
|
|
60
|
+
left: 0,
|
|
61
|
+
right: 0,
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
justifyContent: 'space-between',
|
|
64
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
65
|
+
zIndex: 999,
|
|
66
|
+
},
|
|
67
|
+
counter: {
|
|
68
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
69
|
+
paddingHorizontal: tokens.spacing.md,
|
|
70
|
+
paddingVertical: tokens.spacing.xs,
|
|
71
|
+
borderRadius: tokens.spacing.pill || 20,
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
},
|
|
74
|
+
counterText: {
|
|
75
|
+
...tokens.typography.bodyMedium,
|
|
76
|
+
color: '#FFFFFF',
|
|
77
|
+
fontWeight: '600',
|
|
78
|
+
},
|
|
79
|
+
closeButton: {
|
|
80
|
+
width: 40,
|
|
81
|
+
height: 40,
|
|
82
|
+
borderRadius: 20,
|
|
83
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
32
89
|
return (
|
|
33
90
|
<ImageGallery
|
|
34
91
|
images={creations.map((c) => ({ uri: c.uri }))}
|
|
@@ -36,6 +93,7 @@ export const CreationImageViewer: React.FC<CreationImageViewerProps> = ({
|
|
|
36
93
|
index={index}
|
|
37
94
|
onDismiss={onDismiss}
|
|
38
95
|
onIndexChange={onIndexChange}
|
|
96
|
+
HeaderComponent={HeaderComponent}
|
|
39
97
|
{...(enableEditing && { enableEditing } as any)}
|
|
40
98
|
{...(onImageEdit && { onImageChange: handleImageChange } as any)}
|
|
41
99
|
/>
|
|
@@ -41,6 +41,7 @@ interface CreationsGalleryScreenProps {
|
|
|
41
41
|
readonly headerTitle?: string;
|
|
42
42
|
readonly showCount?: boolean;
|
|
43
43
|
readonly enableSearch?: boolean;
|
|
44
|
+
readonly enableFilter?: boolean;
|
|
44
45
|
readonly showGalleryHeader?: boolean;
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -57,6 +58,7 @@ export function CreationsGalleryScreen({
|
|
|
57
58
|
headerTitle,
|
|
58
59
|
showCount = true,
|
|
59
60
|
enableSearch = true,
|
|
61
|
+
enableFilter = false,
|
|
60
62
|
showGalleryHeader = true,
|
|
61
63
|
}: CreationsGalleryScreenProps) {
|
|
62
64
|
const tokens = useAppDesignTokens();
|
|
@@ -215,7 +217,7 @@ export function CreationsGalleryScreen({
|
|
|
215
217
|
onFilterPress={() => filterSheetRef.current?.present()}
|
|
216
218
|
onFavoritesPress={() => setShowOnlyFavorites(!showOnlyFavorites)}
|
|
217
219
|
showOnlyFavorites={showOnlyFavorites}
|
|
218
|
-
isFilterEnabled={
|
|
220
|
+
isFilterEnabled={enableFilter}
|
|
219
221
|
showCount={showCount}
|
|
220
222
|
/>
|
|
221
223
|
) : null
|