@umituz/react-native-ai-generation-content 1.12.33 → 1.12.35
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 +3 -1
- package/src/domains/creations/presentation/components/CreationCard.tsx +8 -9
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +3 -0
- package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +11 -0
- 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.35",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@umituz/react-native-firebase": "*",
|
|
46
46
|
"@umituz/react-native-image": "*",
|
|
47
47
|
"@umituz/react-native-offline": "*",
|
|
48
|
+
"@umituz/react-native-timezone": "*",
|
|
48
49
|
"@umituz/react-native-uuid": "*",
|
|
49
50
|
"expo-linear-gradient": ">=15.0.0",
|
|
50
51
|
"firebase": ">=10.0.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@umituz/react-native-haptics": "^1.0.2",
|
|
72
73
|
"@umituz/react-native-image": "*",
|
|
73
74
|
"@umituz/react-native-offline": "*",
|
|
75
|
+
"@umituz/react-native-timezone": "^1.3.4",
|
|
74
76
|
"@umituz/react-native-uuid": "*",
|
|
75
77
|
"eslint": "^8.57.0",
|
|
76
78
|
"expo-application": "^7.0.8",
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CreationCard Component
|
|
3
|
-
* Displays a creation item with actions
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import React, { useMemo, useCallback } from "react";
|
|
7
2
|
import { View, Image, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
3
|
import {
|
|
@@ -10,6 +5,7 @@ import {
|
|
|
10
5
|
AtomicIcon,
|
|
11
6
|
useAppDesignTokens,
|
|
12
7
|
} from "@umituz/react-native-design-system";
|
|
8
|
+
import { timezoneService } from "@umituz/react-native-timezone";
|
|
13
9
|
import type { Creation } from "../../domain/entities/Creation";
|
|
14
10
|
import type { CreationType } from "../../domain/value-objects/CreationsConfig";
|
|
15
11
|
|
|
@@ -20,6 +16,7 @@ interface CreationCardProps {
|
|
|
20
16
|
readonly onShare: (creation: Creation) => void;
|
|
21
17
|
readonly onDelete: (creation: Creation) => void;
|
|
22
18
|
readonly onFavorite?: (creation: Creation, isFavorite: boolean) => void;
|
|
19
|
+
readonly locale?: string;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export function CreationCard({
|
|
@@ -29,11 +26,12 @@ export function CreationCard({
|
|
|
29
26
|
onShare,
|
|
30
27
|
onDelete,
|
|
31
28
|
onFavorite,
|
|
29
|
+
locale = "en-US",
|
|
32
30
|
}: CreationCardProps) {
|
|
33
31
|
const tokens = useAppDesignTokens();
|
|
34
32
|
|
|
35
33
|
const typeConfig = types.find((t) => t.id === creation.type);
|
|
36
|
-
const icon = typeConfig?.icon
|
|
34
|
+
const icon = typeConfig?.icon;
|
|
37
35
|
const label = typeConfig?.labelKey || creation.type;
|
|
38
36
|
|
|
39
37
|
const handleView = useCallback(() => onView?.(creation), [creation, onView]);
|
|
@@ -52,13 +50,14 @@ export function CreationCard({
|
|
|
52
50
|
creation.createdAt instanceof Date
|
|
53
51
|
? creation.createdAt
|
|
54
52
|
: new Date(creation.createdAt);
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
|
|
54
|
+
return timezoneService.formatDateTime(date, locale, {
|
|
57
55
|
month: "short",
|
|
56
|
+
day: "numeric",
|
|
58
57
|
hour: "2-digit",
|
|
59
58
|
minute: "2-digit",
|
|
60
59
|
});
|
|
61
|
-
}, [creation.createdAt]);
|
|
60
|
+
}, [creation.createdAt, locale]);
|
|
62
61
|
|
|
63
62
|
const styles = useMemo(
|
|
64
63
|
() =>
|
|
@@ -14,6 +14,7 @@ interface CreationsGridProps {
|
|
|
14
14
|
readonly onShare: (creation: Creation) => void;
|
|
15
15
|
readonly onDelete: (creation: Creation) => void;
|
|
16
16
|
readonly onFavorite?: (creation: Creation, isFavorite: boolean) => void;
|
|
17
|
+
readonly locale?: string;
|
|
17
18
|
readonly contentContainerStyle?: ViewStyle;
|
|
18
19
|
readonly ListEmptyComponent?: React.ReactElement | null;
|
|
19
20
|
readonly ListHeaderComponent?: React.ComponentType<unknown> | React.ReactElement | null;
|
|
@@ -28,6 +29,7 @@ export const CreationsGrid: React.FC<CreationsGridProps> = ({
|
|
|
28
29
|
onShare,
|
|
29
30
|
onDelete,
|
|
30
31
|
onFavorite,
|
|
32
|
+
locale,
|
|
31
33
|
contentContainerStyle,
|
|
32
34
|
ListEmptyComponent,
|
|
33
35
|
ListHeaderComponent,
|
|
@@ -43,6 +45,7 @@ export const CreationsGrid: React.FC<CreationsGridProps> = ({
|
|
|
43
45
|
onShare={() => onShare(item)}
|
|
44
46
|
onDelete={() => onDelete(item)}
|
|
45
47
|
onFavorite={onFavorite ? (creation, isFavorite) => onFavorite(creation, isFavorite) : undefined}
|
|
48
|
+
locale={locale}
|
|
46
49
|
/>
|
|
47
50
|
);
|
|
48
51
|
|
|
@@ -64,10 +64,21 @@ export const FilterBottomSheet = forwardRef<BottomSheetModal, FilterBottomSheetP
|
|
|
64
64
|
);
|
|
65
65
|
}, [onFilterPress, selectedIds, styles]);
|
|
66
66
|
|
|
67
|
+
const backgroundStyle = useMemo(() => ({
|
|
68
|
+
backgroundColor: tokens.colors.surface,
|
|
69
|
+
}), [tokens.colors.surface]);
|
|
70
|
+
|
|
71
|
+
const handleIndicatorStyle = useMemo(() => ({
|
|
72
|
+
backgroundColor: tokens.colors.outline,
|
|
73
|
+
}), [tokens.colors.outline]);
|
|
74
|
+
|
|
67
75
|
return (
|
|
68
76
|
<BottomSheetModal
|
|
69
77
|
ref={ref}
|
|
70
78
|
snapPoints={snapPoints}
|
|
79
|
+
backgroundStyle={backgroundStyle}
|
|
80
|
+
handleIndicatorStyle={handleIndicatorStyle}
|
|
81
|
+
enablePanDownToClose
|
|
71
82
|
>
|
|
72
83
|
<View style={styles.header}>
|
|
73
84
|
<AtomicText style={styles.headerTitle}>{title}</AtomicText>
|
|
@@ -19,6 +19,7 @@ interface CreationsGalleryScreenProps {
|
|
|
19
19
|
readonly repository: ICreationsRepository;
|
|
20
20
|
readonly config: CreationsConfig;
|
|
21
21
|
readonly t: (key: string) => string;
|
|
22
|
+
readonly locale?: string;
|
|
22
23
|
readonly enableEditing?: boolean;
|
|
23
24
|
readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
|
|
24
25
|
readonly onEmptyAction?: () => void;
|
|
@@ -30,6 +31,7 @@ export function CreationsGalleryScreen({
|
|
|
30
31
|
repository,
|
|
31
32
|
config,
|
|
32
33
|
t,
|
|
34
|
+
locale = "en-US",
|
|
33
35
|
enableEditing = false,
|
|
34
36
|
onImageEdit,
|
|
35
37
|
onEmptyAction,
|
|
@@ -162,6 +164,7 @@ export function CreationsGalleryScreen({
|
|
|
162
164
|
onShare={handleShare}
|
|
163
165
|
onDelete={handleDelete}
|
|
164
166
|
onFavorite={handleFavorite}
|
|
167
|
+
locale={locale}
|
|
165
168
|
contentContainerStyle={{ paddingBottom: insets.bottom + tokens.spacing.xl }}
|
|
166
169
|
ListEmptyComponent={renderEmptyComponent}
|
|
167
170
|
/>
|