@umituz/react-native-ai-generation-content 1.12.40 → 1.12.42
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 +6 -2
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +2 -0
- package/src/domains/creations/domain/value-objects/index.ts +0 -1
- package/src/domains/creations/index.ts +0 -1
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +29 -17
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +3 -0
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.42",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -71,7 +71,9 @@
|
|
|
71
71
|
"@umituz/react-native-firebase": "^1.13.20",
|
|
72
72
|
"@umituz/react-native-haptics": "^1.0.2",
|
|
73
73
|
"@umituz/react-native-image": "*",
|
|
74
|
+
"@umituz/react-native-localization": "^3.5.36",
|
|
74
75
|
"@umituz/react-native-offline": "*",
|
|
76
|
+
"@umituz/react-native-storage": "^2.4.5",
|
|
75
77
|
"@umituz/react-native-timezone": "^1.3.4",
|
|
76
78
|
"@umituz/react-native-uuid": "*",
|
|
77
79
|
"eslint": "^8.57.0",
|
|
@@ -86,7 +88,9 @@
|
|
|
86
88
|
"expo-localization": "^17.0.8",
|
|
87
89
|
"expo-sharing": "^14.0.8",
|
|
88
90
|
"firebase": "^11.1.0",
|
|
91
|
+
"i18next": "^25.7.3",
|
|
89
92
|
"react": "19.1.0",
|
|
93
|
+
"react-i18next": "^16.5.0",
|
|
90
94
|
"react-native": "0.81.5",
|
|
91
95
|
"react-native-gesture-handler": "^2.30.0",
|
|
92
96
|
"react-native-reanimated": "^4.2.1",
|
|
@@ -98,4 +102,4 @@
|
|
|
98
102
|
"publishConfig": {
|
|
99
103
|
"access": "public"
|
|
100
104
|
}
|
|
101
|
-
}
|
|
105
|
+
}
|
|
@@ -36,6 +36,7 @@ export interface CreationsConfig {
|
|
|
36
36
|
readonly types: readonly CreationType[];
|
|
37
37
|
readonly filterCategories?: readonly FilterCategory[];
|
|
38
38
|
readonly translations: CreationsTranslations;
|
|
39
|
+
readonly showFilter?: boolean;
|
|
39
40
|
readonly maxThumbnails?: number;
|
|
40
41
|
readonly gridColumns?: number;
|
|
41
42
|
readonly documentMapper?: DocumentMapper;
|
|
@@ -58,6 +59,7 @@ export const DEFAULT_CONFIG: CreationsConfig = {
|
|
|
58
59
|
collectionName: "creations",
|
|
59
60
|
types: [],
|
|
60
61
|
translations: DEFAULT_TRANSLATIONS,
|
|
62
|
+
showFilter: true,
|
|
61
63
|
maxThumbnails: 4,
|
|
62
64
|
gridColumns: 2,
|
|
63
65
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
declare const __DEV__: boolean;
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { View, TouchableOpacity, StyleSheet, type ViewStyle } from 'react-native';
|
|
3
5
|
import { AtomicText, AtomicIcon, useAppDesignTokens, type DesignTokens } from "@umituz/react-native-design-system";
|
|
@@ -8,6 +10,7 @@ interface GalleryHeaderProps {
|
|
|
8
10
|
readonly countLabel: string;
|
|
9
11
|
readonly isFiltered: boolean;
|
|
10
12
|
readonly onFilterPress: () => void;
|
|
13
|
+
readonly showFilter?: boolean;
|
|
11
14
|
readonly filterLabel?: string;
|
|
12
15
|
readonly filterIcon?: string;
|
|
13
16
|
readonly style?: ViewStyle;
|
|
@@ -19,6 +22,7 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
19
22
|
countLabel,
|
|
20
23
|
isFiltered,
|
|
21
24
|
onFilterPress,
|
|
25
|
+
showFilter = true,
|
|
22
26
|
filterLabel = 'Filter',
|
|
23
27
|
filterIcon = 'filter-outline',
|
|
24
28
|
style,
|
|
@@ -34,23 +38,31 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
34
38
|
{count} {countLabel}
|
|
35
39
|
</AtomicText>
|
|
36
40
|
</View>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
{showFilter && (
|
|
42
|
+
<TouchableOpacity
|
|
43
|
+
onPress={() => {
|
|
44
|
+
if (__DEV__) {
|
|
45
|
+
// eslint-disable-next-line no-console
|
|
46
|
+
console.log('[GalleryHeader] Filter button pressed');
|
|
47
|
+
}
|
|
48
|
+
onFilterPress();
|
|
49
|
+
}}
|
|
50
|
+
style={[styles.filterButton, isFiltered && styles.filterButtonActive]}
|
|
51
|
+
activeOpacity={0.7}
|
|
52
|
+
>
|
|
53
|
+
<AtomicIcon
|
|
54
|
+
name={filterIcon}
|
|
55
|
+
size="sm"
|
|
56
|
+
color={isFiltered ? "primary" : "secondary"}
|
|
57
|
+
/>
|
|
58
|
+
<AtomicText style={[styles.filterText, { color: isFiltered ? tokens.colors.primary : tokens.colors.textSecondary }]}>
|
|
59
|
+
{filterLabel}
|
|
60
|
+
</AtomicText>
|
|
61
|
+
{isFiltered && (
|
|
62
|
+
<View style={styles.badge} />
|
|
63
|
+
)}
|
|
64
|
+
</TouchableOpacity>
|
|
65
|
+
)}
|
|
54
66
|
</View>
|
|
55
67
|
);
|
|
56
68
|
};
|
|
@@ -34,6 +34,7 @@ interface CreationsGalleryScreenProps {
|
|
|
34
34
|
readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
|
|
35
35
|
readonly onEmptyAction?: () => void;
|
|
36
36
|
readonly emptyActionLabel?: string;
|
|
37
|
+
readonly showFilter?: boolean;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export function CreationsGalleryScreen({
|
|
@@ -46,6 +47,7 @@ export function CreationsGalleryScreen({
|
|
|
46
47
|
onImageEdit,
|
|
47
48
|
onEmptyAction,
|
|
48
49
|
emptyActionLabel,
|
|
50
|
+
showFilter = config.showFilter ?? true,
|
|
49
51
|
}: CreationsGalleryScreenProps) {
|
|
50
52
|
const tokens = useAppDesignTokens();
|
|
51
53
|
const insets = useSafeAreaInsets();
|
|
@@ -160,6 +162,7 @@ export function CreationsGalleryScreen({
|
|
|
160
162
|
count={filtered.length}
|
|
161
163
|
countLabel={t(config.translations.photoCount) || 'photos'}
|
|
162
164
|
isFiltered={isFiltered}
|
|
165
|
+
showFilter={showFilter}
|
|
163
166
|
filterLabel={t(config.translations.filterLabel) || 'Filter'}
|
|
164
167
|
onFilterPress={() => {
|
|
165
168
|
if (__DEV__) {
|