@umituz/react-native-ai-generation-content 1.12.21 → 1.12.24
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 +33 -15
- package/src/domains/content-moderation/infrastructure/services/content-moderation.service.ts +4 -32
- package/src/domains/content-moderation/infrastructure/services/moderators/base.moderator.ts +1 -1
- package/src/domains/face-detection/infrastructure/validators/faceValidator.ts +1 -1
- package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +3 -3
- package/src/domains/prompts/domain/entities/FuturePredictionConfig.ts +2 -1
- package/src/domains/prompts/domain/entities/GeneratedPrompt.ts +0 -1
- package/src/domains/prompts/domain/repositories/IAIPromptServices.ts +6 -12
- package/src/domains/prompts/infrastructure/repositories/PromptHistoryRepository.ts +42 -42
- package/src/domains/prompts/infrastructure/repositories/TemplateRepository.ts +42 -42
- package/src/domains/prompts/infrastructure/services/BackgroundRemovalService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/ColorizationService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/FaceSwapService.ts +19 -20
- package/src/domains/prompts/infrastructure/services/FuturePredictionService.ts +11 -31
- package/src/domains/prompts/infrastructure/services/ImageEnhancementService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/PhotoRestorationService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/PromptGenerationService.ts +13 -13
- package/src/domains/prompts/infrastructure/services/StyleTransferService.ts +8 -8
- package/src/domains/prompts/infrastructure/services/TextGenerationService.ts +7 -7
- package/src/domains/prompts/presentation/hooks/useAIServices.ts +30 -28
- package/src/domains/prompts/presentation/hooks/useFaceSwap.ts +1 -2
- package/src/domains/prompts/presentation/hooks/usePromptGeneration.ts +4 -5
- package/src/domains/prompts/presentation/hooks/useStyleTransfer.ts +1 -1
- package/src/domains/prompts/presentation/hooks/useTemplateRepository.ts +3 -3
- package/src/domains/prompts/presentation/theme/utils.ts +1 -1
- package/src/features/audio-generation/domain/entities.ts +39 -0
- package/src/features/audio-generation/index.ts +2 -0
- package/src/features/audio-generation/presentation/hooks.ts +39 -0
- package/src/{domains/feature-background → features/background}/presentation/components/BackgroundFeature.tsx +5 -4
- package/src/{domains/feature-background → features/background}/presentation/components/ComparisonSlider.tsx +45 -51
- package/src/{domains/feature-background → features/background}/presentation/components/ErrorDisplay.tsx +5 -3
- package/src/{domains/feature-background → features/background}/presentation/components/ModeSelector.tsx +2 -2
- package/src/{domains/feature-background → features/background}/presentation/hooks/useBackgroundFeature.ts +3 -2
- package/src/features/colorization/domain/entities.ts +46 -0
- package/src/features/colorization/index.ts +2 -0
- package/src/features/colorization/presentation/hooks.ts +39 -0
- package/src/features/face-swap/domain/entities.ts +48 -0
- package/src/features/face-swap/index.ts +2 -0
- package/src/features/face-swap/presentation/hooks.ts +41 -0
- package/src/features/future-prediction/domain/entities.ts +45 -0
- package/src/features/future-prediction/index.ts +2 -0
- package/src/features/future-prediction/presentation/hooks.ts +39 -0
- package/src/features/image-captioning/domain/entities.ts +47 -0
- package/src/features/image-captioning/index.ts +2 -0
- package/src/features/image-captioning/presentation/hooks.ts +39 -0
- package/src/features/inpainting/domain/entities.ts +58 -0
- package/src/features/inpainting/index.ts +2 -0
- package/src/features/inpainting/presentation/hooks.ts +39 -0
- package/src/features/photo-restoration/domain/entities.ts +48 -0
- package/src/features/photo-restoration/index.ts +2 -0
- package/src/features/photo-restoration/presentation/hooks.ts +39 -0
- package/src/features/sketch-to-image/domain/entities.ts +47 -0
- package/src/features/sketch-to-image/index.ts +2 -0
- package/src/features/sketch-to-image/presentation/hooks.ts +39 -0
- package/src/features/style-transfer/domain/entities.ts +52 -0
- package/src/features/style-transfer/index.ts +2 -0
- package/src/features/style-transfer/presentation/hooks.ts +39 -0
- package/src/features/text-to-image/domain/entities.ts +58 -0
- package/src/features/text-to-image/index.ts +2 -0
- package/src/features/text-to-image/presentation/hooks.ts +39 -0
- package/src/features/text-to-video/domain/entities.ts +52 -0
- package/src/features/text-to-video/index.ts +2 -0
- package/src/features/text-to-video/presentation/hooks.ts +39 -0
- package/src/features/upscaling/domain/entities.ts +42 -0
- package/src/features/upscaling/index.ts +2 -0
- package/src/features/upscaling/presentation/hooks.ts +39 -0
- package/src/index.ts +3 -6
- package/src/infrastructure/utils/status-checker.util.ts +4 -4
- package/src/infrastructure/wrappers/synchronous-generation.wrapper.ts +3 -3
- package/src/presentation/components/result/GenerationResultContent.tsx +21 -22
- package/src/presentation/components/result/ResultActions.tsx +51 -52
- package/src/presentation/components/result/ResultHeader.tsx +24 -25
- package/src/presentation/components/result/ResultImageCard.tsx +19 -20
- package/src/presentation/components/result/ResultStoryCard.tsx +23 -24
- package/src/presentation/hooks/photo-generation.types.ts +13 -4
- package/src/presentation/hooks/usePhotoGeneration.ts +30 -13
- package/src/domains/creations/application/services/CreationsService.ts +0 -72
- package/src/domains/creations/domain/entities/Creation.ts +0 -54
- package/src/domains/creations/domain/entities/index.ts +0 -6
- package/src/domains/creations/domain/repositories/ICreationsRepository.ts +0 -25
- package/src/domains/creations/domain/repositories/index.ts +0 -5
- package/src/domains/creations/domain/services/ICreationsStorageService.ts +0 -13
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +0 -77
- package/src/domains/creations/domain/value-objects/index.ts +0 -12
- package/src/domains/creations/index.ts +0 -84
- package/src/domains/creations/infrastructure/adapters/createRepository.ts +0 -54
- package/src/domains/creations/infrastructure/adapters/index.ts +0 -5
- package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +0 -263
- package/src/domains/creations/infrastructure/repositories/index.ts +0 -8
- package/src/domains/creations/infrastructure/services/CreationsStorageService.ts +0 -48
- package/src/domains/creations/presentation/components/CreationCard.tsx +0 -196
- package/src/domains/creations/presentation/components/CreationDetail/DetailActions.tsx +0 -76
- package/src/domains/creations/presentation/components/CreationDetail/DetailHeader.tsx +0 -81
- package/src/domains/creations/presentation/components/CreationDetail/DetailImage.tsx +0 -41
- package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +0 -67
- package/src/domains/creations/presentation/components/CreationDetail/index.ts +0 -4
- package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -101
- package/src/domains/creations/presentation/components/CreationThumbnail.tsx +0 -63
- package/src/domains/creations/presentation/components/CreationsGalleryEmptyState.tsx +0 -77
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -87
- package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +0 -176
- package/src/domains/creations/presentation/components/EmptyState.tsx +0 -75
- package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +0 -157
- package/src/domains/creations/presentation/components/FilterChips.tsx +0 -105
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +0 -157
- package/src/domains/creations/presentation/components/index.ts +0 -20
- package/src/domains/creations/presentation/hooks/index.ts +0 -9
- package/src/domains/creations/presentation/hooks/useCreations.ts +0 -33
- package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +0 -90
- package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +0 -51
- package/src/domains/creations/presentation/hooks/useDeleteMultipleCreations.ts +0 -57
- package/src/domains/creations/presentation/hooks/useToggleFavorite.ts +0 -59
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +0 -71
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -264
- package/src/domains/creations/presentation/screens/index.ts +0 -5
- package/src/domains/creations/presentation/utils/filterUtils.ts +0 -52
- package/src/domains/creations/types.d.ts +0 -107
- /package/src/{domains/feature-background → features/background}/domain/entities/background.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/component.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/config.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/infrastructure/constants/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/infrastructure/constants/prompts.constants.ts +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/FeatureHeader.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/GenerateButton.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/ImagePicker.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/ProcessingModal.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/PromptInput.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/ResultDisplay.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/hooks/index.ts +0 -0
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CreationCard Component
|
|
3
|
-
* Displays a creation item with actions
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useMemo, useCallback } from "react";
|
|
7
|
-
import { View, Image, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
-
import {
|
|
9
|
-
AtomicText,
|
|
10
|
-
AtomicIcon,
|
|
11
|
-
useAppDesignTokens,
|
|
12
|
-
} from "@umituz/react-native-design-system";
|
|
13
|
-
import type { Creation } from "../../domain/entities/Creation";
|
|
14
|
-
import type { CreationType } from "../../domain/value-objects/CreationsConfig";
|
|
15
|
-
|
|
16
|
-
interface CreationCardProps {
|
|
17
|
-
readonly creation: Creation;
|
|
18
|
-
readonly types: readonly CreationType[];
|
|
19
|
-
readonly onView?: (creation: Creation) => void;
|
|
20
|
-
readonly onShare: (creation: Creation) => void;
|
|
21
|
-
readonly onDelete: (creation: Creation) => void;
|
|
22
|
-
readonly onToggleFavorite?: (creation: Creation) => void;
|
|
23
|
-
readonly isSelected?: boolean;
|
|
24
|
-
readonly onSelect?: (creation: Creation) => void;
|
|
25
|
-
readonly isSelectionMode?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function CreationCard({
|
|
29
|
-
creation,
|
|
30
|
-
types,
|
|
31
|
-
onView,
|
|
32
|
-
onShare,
|
|
33
|
-
onDelete,
|
|
34
|
-
onToggleFavorite,
|
|
35
|
-
isSelected,
|
|
36
|
-
onSelect,
|
|
37
|
-
isSelectionMode,
|
|
38
|
-
}: CreationCardProps) {
|
|
39
|
-
const tokens = useAppDesignTokens();
|
|
40
|
-
|
|
41
|
-
const typeConfig = types.find((t) => t.id === creation.type);
|
|
42
|
-
const icon = typeConfig?.icon || "🎨";
|
|
43
|
-
const label = typeConfig?.labelKey || creation.type;
|
|
44
|
-
|
|
45
|
-
const handleView = useCallback(() => onView?.(creation), [creation, onView]);
|
|
46
|
-
const handleShare = useCallback(() => onShare(creation), [creation, onShare]);
|
|
47
|
-
const handleDelete = useCallback(
|
|
48
|
-
() => onDelete(creation),
|
|
49
|
-
[creation, onDelete],
|
|
50
|
-
);
|
|
51
|
-
const handleToggleFavorite = useCallback(
|
|
52
|
-
() => onToggleFavorite?.(creation),
|
|
53
|
-
[creation, onToggleFavorite],
|
|
54
|
-
);
|
|
55
|
-
const handleSelect = useCallback(
|
|
56
|
-
() => onSelect?.(creation),
|
|
57
|
-
[creation, onSelect],
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const formattedDate = useMemo(() => {
|
|
61
|
-
const date =
|
|
62
|
-
creation.createdAt instanceof Date
|
|
63
|
-
? creation.createdAt
|
|
64
|
-
: new Date(creation.createdAt);
|
|
65
|
-
return date.toLocaleDateString(undefined, {
|
|
66
|
-
day: "numeric",
|
|
67
|
-
month: "short",
|
|
68
|
-
hour: "2-digit",
|
|
69
|
-
minute: "2-digit",
|
|
70
|
-
});
|
|
71
|
-
}, [creation.createdAt]);
|
|
72
|
-
|
|
73
|
-
const styles = useMemo(
|
|
74
|
-
() =>
|
|
75
|
-
StyleSheet.create({
|
|
76
|
-
container: {
|
|
77
|
-
flexDirection: "row",
|
|
78
|
-
backgroundColor: tokens.colors.surface,
|
|
79
|
-
borderRadius: tokens.spacing.md,
|
|
80
|
-
overflow: "hidden",
|
|
81
|
-
marginBottom: tokens.spacing.md,
|
|
82
|
-
borderWidth: 1,
|
|
83
|
-
borderColor: isSelected ? tokens.colors.primary : "transparent",
|
|
84
|
-
},
|
|
85
|
-
imageContainer: {
|
|
86
|
-
width: 100,
|
|
87
|
-
height: 100,
|
|
88
|
-
position: "relative",
|
|
89
|
-
},
|
|
90
|
-
thumbnail: {
|
|
91
|
-
width: 100,
|
|
92
|
-
height: 100,
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
selectionOverlay: {
|
|
96
|
-
position: "absolute",
|
|
97
|
-
top: 4,
|
|
98
|
-
left: 4,
|
|
99
|
-
width: 24,
|
|
100
|
-
height: 24,
|
|
101
|
-
borderRadius: 12,
|
|
102
|
-
backgroundColor: isSelected ? tokens.colors.primary : "rgba(255,255,255,0.5)",
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
alignItems: "center",
|
|
105
|
-
borderWidth: 1,
|
|
106
|
-
borderColor: tokens.colors.primary,
|
|
107
|
-
},
|
|
108
|
-
content: {
|
|
109
|
-
flex: 1,
|
|
110
|
-
padding: tokens.spacing.md,
|
|
111
|
-
justifyContent: "space-between",
|
|
112
|
-
},
|
|
113
|
-
typeRow: {
|
|
114
|
-
flexDirection: "row",
|
|
115
|
-
alignItems: "center",
|
|
116
|
-
gap: tokens.spacing.sm,
|
|
117
|
-
},
|
|
118
|
-
icon: {
|
|
119
|
-
fontSize: 20,
|
|
120
|
-
},
|
|
121
|
-
typeText: {
|
|
122
|
-
...tokens.typography.bodyMedium,
|
|
123
|
-
fontWeight: "600",
|
|
124
|
-
color: tokens.colors.textPrimary,
|
|
125
|
-
},
|
|
126
|
-
dateText: {
|
|
127
|
-
...tokens.typography.bodySmall,
|
|
128
|
-
color: tokens.colors.textSecondary,
|
|
129
|
-
},
|
|
130
|
-
actions: {
|
|
131
|
-
flexDirection: "row",
|
|
132
|
-
gap: tokens.spacing.sm,
|
|
133
|
-
},
|
|
134
|
-
actionBtn: {
|
|
135
|
-
width: 36,
|
|
136
|
-
height: 36,
|
|
137
|
-
borderRadius: 18,
|
|
138
|
-
backgroundColor: tokens.colors.backgroundSecondary,
|
|
139
|
-
justifyContent: "center",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
},
|
|
142
|
-
}),
|
|
143
|
-
[tokens, isSelected],
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<TouchableOpacity
|
|
148
|
-
activeOpacity={0.9}
|
|
149
|
-
style={styles.container}
|
|
150
|
-
onPress={isSelectionMode ? handleSelect : handleView}
|
|
151
|
-
onLongPress={handleSelect}
|
|
152
|
-
>
|
|
153
|
-
<View style={styles.imageContainer}>
|
|
154
|
-
<Image source={{ uri: creation.uri }} style={styles.thumbnail} />
|
|
155
|
-
{isSelectionMode && (
|
|
156
|
-
<View style={styles.selectionOverlay}>
|
|
157
|
-
{isSelected && <AtomicIcon name="checkmark-circle" size="xs" color="onPrimary" />}
|
|
158
|
-
</View>
|
|
159
|
-
)}
|
|
160
|
-
</View>
|
|
161
|
-
<View style={styles.content}>
|
|
162
|
-
<View>
|
|
163
|
-
<View style={styles.typeRow}>
|
|
164
|
-
<AtomicText style={styles.icon}>{icon}</AtomicText>
|
|
165
|
-
<AtomicText style={styles.typeText}>{label}</AtomicText>
|
|
166
|
-
</View>
|
|
167
|
-
<AtomicText style={styles.dateText}>{formattedDate}</AtomicText>
|
|
168
|
-
</View>
|
|
169
|
-
{!isSelectionMode && (
|
|
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
|
-
)}
|
|
185
|
-
<TouchableOpacity style={styles.actionBtn} onPress={handleShare}>
|
|
186
|
-
<AtomicIcon name="share-social" size="sm" color="primary" />
|
|
187
|
-
</TouchableOpacity>
|
|
188
|
-
<TouchableOpacity style={styles.actionBtn} onPress={handleDelete}>
|
|
189
|
-
<AtomicIcon name="trash" size="sm" color="error" />
|
|
190
|
-
</TouchableOpacity>
|
|
191
|
-
</View>
|
|
192
|
-
)}
|
|
193
|
-
</View>
|
|
194
|
-
</TouchableOpacity>
|
|
195
|
-
);
|
|
196
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
-
import { AtomicText, AtomicIcon, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
|
-
|
|
6
|
-
interface DetailActionsProps {
|
|
7
|
-
readonly onShare: () => void;
|
|
8
|
-
readonly onDelete: () => void;
|
|
9
|
-
readonly shareLabel: string;
|
|
10
|
-
readonly deleteLabel: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const DetailActions: React.FC<DetailActionsProps> = ({
|
|
14
|
-
onShare,
|
|
15
|
-
onDelete,
|
|
16
|
-
shareLabel,
|
|
17
|
-
deleteLabel
|
|
18
|
-
}) => {
|
|
19
|
-
const tokens = useAppDesignTokens();
|
|
20
|
-
const styles = useStyles(tokens);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<View style={styles.container}>
|
|
24
|
-
<TouchableOpacity
|
|
25
|
-
style={[styles.button, styles.shareButton]}
|
|
26
|
-
onPress={onShare}
|
|
27
|
-
activeOpacity={0.7}
|
|
28
|
-
>
|
|
29
|
-
<AtomicIcon name="share-social-outline" size="sm" color="onPrimary" />
|
|
30
|
-
<AtomicText style={styles.buttonText}>{shareLabel}</AtomicText>
|
|
31
|
-
</TouchableOpacity>
|
|
32
|
-
|
|
33
|
-
<TouchableOpacity
|
|
34
|
-
style={[styles.button, styles.deleteButton]}
|
|
35
|
-
onPress={onDelete}
|
|
36
|
-
activeOpacity={0.7}
|
|
37
|
-
>
|
|
38
|
-
<AtomicIcon name="trash-outline" size="sm" color="error" />
|
|
39
|
-
<AtomicText style={[styles.buttonText, { color: tokens.colors.error }]}>
|
|
40
|
-
{deleteLabel}
|
|
41
|
-
</AtomicText>
|
|
42
|
-
</TouchableOpacity>
|
|
43
|
-
</View>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const useStyles = (tokens: any) => StyleSheet.create({
|
|
48
|
-
container: {
|
|
49
|
-
flexDirection: 'row',
|
|
50
|
-
justifyContent: 'center',
|
|
51
|
-
gap: tokens.spacing.md,
|
|
52
|
-
paddingHorizontal: tokens.spacing.lg,
|
|
53
|
-
marginBottom: tokens.spacing.xxl,
|
|
54
|
-
},
|
|
55
|
-
button: {
|
|
56
|
-
flexDirection: 'row',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
paddingVertical: 12,
|
|
60
|
-
paddingHorizontal: 24,
|
|
61
|
-
borderRadius: 16,
|
|
62
|
-
gap: 8,
|
|
63
|
-
minWidth: 120,
|
|
64
|
-
},
|
|
65
|
-
shareButton: {
|
|
66
|
-
backgroundColor: tokens.colors.primary,
|
|
67
|
-
},
|
|
68
|
-
deleteButton: {
|
|
69
|
-
backgroundColor: tokens.colors.error + '10',
|
|
70
|
-
},
|
|
71
|
-
buttonText: {
|
|
72
|
-
fontWeight: '700',
|
|
73
|
-
color: '#fff',
|
|
74
|
-
fontSize: 15,
|
|
75
|
-
},
|
|
76
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
-
import { AtomicText, AtomicIcon, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
-
|
|
7
|
-
interface DetailHeaderProps {
|
|
8
|
-
readonly title: string;
|
|
9
|
-
readonly date: string;
|
|
10
|
-
readonly onClose: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const DetailHeader: React.FC<DetailHeaderProps> = ({ title, date, onClose }) => {
|
|
14
|
-
const tokens = useAppDesignTokens();
|
|
15
|
-
const insets = useSafeAreaInsets();
|
|
16
|
-
const styles = useStyles(tokens, insets);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<View style={styles.headerContainer}>
|
|
20
|
-
<TouchableOpacity style={styles.closeButton} onPress={onClose}>
|
|
21
|
-
<AtomicIcon name="arrow-back" size={24} customColor={tokens.colors.textPrimary} />
|
|
22
|
-
</TouchableOpacity>
|
|
23
|
-
|
|
24
|
-
<View style={styles.titleContainer}>
|
|
25
|
-
<AtomicText style={styles.title} numberOfLines={1}>{title}</AtomicText>
|
|
26
|
-
<View style={styles.dateBadge}>
|
|
27
|
-
<AtomicIcon name="calendar-outline" size={12} customColor={tokens.colors.primary} />
|
|
28
|
-
<AtomicText style={styles.dateText}>{date}</AtomicText>
|
|
29
|
-
</View>
|
|
30
|
-
</View>
|
|
31
|
-
|
|
32
|
-
<View style={styles.placeholder} />
|
|
33
|
-
</View>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const useStyles = (tokens: any, insets: any) => StyleSheet.create({
|
|
38
|
-
headerContainer: {
|
|
39
|
-
flexDirection: 'row',
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
paddingTop: insets.top + tokens.spacing.sm,
|
|
42
|
-
paddingBottom: tokens.spacing.md,
|
|
43
|
-
paddingHorizontal: tokens.spacing.md,
|
|
44
|
-
backgroundColor: tokens.colors.backgroundPrimary,
|
|
45
|
-
borderBottomWidth: 1,
|
|
46
|
-
borderBottomColor: tokens.colors.border,
|
|
47
|
-
zIndex: 10,
|
|
48
|
-
},
|
|
49
|
-
closeButton: {
|
|
50
|
-
padding: tokens.spacing.xs,
|
|
51
|
-
marginRight: tokens.spacing.sm,
|
|
52
|
-
},
|
|
53
|
-
titleContainer: {
|
|
54
|
-
flex: 1,
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
},
|
|
57
|
-
title: {
|
|
58
|
-
fontSize: 18,
|
|
59
|
-
fontWeight: '700',
|
|
60
|
-
color: tokens.colors.textPrimary,
|
|
61
|
-
marginBottom: 4,
|
|
62
|
-
textAlign: 'center',
|
|
63
|
-
},
|
|
64
|
-
dateBadge: {
|
|
65
|
-
flexDirection: 'row',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
gap: 4,
|
|
68
|
-
paddingHorizontal: 10,
|
|
69
|
-
paddingVertical: 4,
|
|
70
|
-
borderRadius: 12,
|
|
71
|
-
backgroundColor: tokens.colors.primary + '15',
|
|
72
|
-
},
|
|
73
|
-
dateText: {
|
|
74
|
-
fontSize: 12,
|
|
75
|
-
fontWeight: '600',
|
|
76
|
-
color: tokens.colors.primary,
|
|
77
|
-
},
|
|
78
|
-
placeholder: {
|
|
79
|
-
width: 40,
|
|
80
|
-
},
|
|
81
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View, StyleSheet, Image, Dimensions } from 'react-native';
|
|
4
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
|
-
|
|
6
|
-
interface DetailImageProps {
|
|
7
|
-
readonly uri: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { width } = Dimensions.get('window');
|
|
11
|
-
|
|
12
|
-
export const DetailImage: React.FC<DetailImageProps> = ({ uri }) => {
|
|
13
|
-
const tokens = useAppDesignTokens();
|
|
14
|
-
const styles = useStyles(tokens);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<View style={styles.container}>
|
|
18
|
-
<View style={styles.frame}>
|
|
19
|
-
<Image source={{ uri }} style={styles.image} resizeMode="cover" />
|
|
20
|
-
</View>
|
|
21
|
-
</View>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const useStyles = (tokens: any) => StyleSheet.create({
|
|
26
|
-
container: {
|
|
27
|
-
paddingHorizontal: tokens.spacing.lg,
|
|
28
|
-
marginVertical: tokens.spacing.lg,
|
|
29
|
-
},
|
|
30
|
-
frame: {
|
|
31
|
-
width: width - (tokens.spacing.lg * 2),
|
|
32
|
-
height: width - (tokens.spacing.lg * 2),
|
|
33
|
-
borderRadius: 24,
|
|
34
|
-
overflow: 'hidden',
|
|
35
|
-
backgroundColor: tokens.colors.surface,
|
|
36
|
-
},
|
|
37
|
-
image: {
|
|
38
|
-
width: '100%',
|
|
39
|
-
height: '100%',
|
|
40
|
-
},
|
|
41
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View, StyleSheet } from 'react-native';
|
|
4
|
-
import { AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
-
|
|
7
|
-
interface DetailStoryProps {
|
|
8
|
-
readonly story: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const DetailStory: React.FC<DetailStoryProps> = ({ story }) => {
|
|
12
|
-
const tokens = useAppDesignTokens();
|
|
13
|
-
const styles = useStyles(tokens);
|
|
14
|
-
|
|
15
|
-
if (!story) return null;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<View style={styles.container}>
|
|
19
|
-
<LinearGradient
|
|
20
|
-
colors={[tokens.colors.primary + '15', tokens.colors.primary + '05']}
|
|
21
|
-
style={styles.gradient}
|
|
22
|
-
>
|
|
23
|
-
<AtomicText style={styles.quoteMark}>"</AtomicText>
|
|
24
|
-
<AtomicText style={styles.text}>{story}</AtomicText>
|
|
25
|
-
<View style={styles.quoteEndRow}>
|
|
26
|
-
<AtomicText style={[styles.quoteMark, styles.quoteEnd]}>"</AtomicText>
|
|
27
|
-
</View>
|
|
28
|
-
</LinearGradient>
|
|
29
|
-
</View>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const useStyles = (tokens: any) => StyleSheet.create({
|
|
34
|
-
container: {
|
|
35
|
-
paddingHorizontal: tokens.spacing.lg,
|
|
36
|
-
marginBottom: tokens.spacing.lg,
|
|
37
|
-
},
|
|
38
|
-
gradient: {
|
|
39
|
-
padding: tokens.spacing.lg,
|
|
40
|
-
borderRadius: 20,
|
|
41
|
-
borderWidth: 1,
|
|
42
|
-
borderColor: tokens.colors.primary + '20',
|
|
43
|
-
},
|
|
44
|
-
quoteMark: {
|
|
45
|
-
fontSize: 48,
|
|
46
|
-
lineHeight: 48,
|
|
47
|
-
color: tokens.colors.primary,
|
|
48
|
-
opacity: 0.4,
|
|
49
|
-
marginBottom: -16,
|
|
50
|
-
},
|
|
51
|
-
quoteEndRow: {
|
|
52
|
-
alignItems: 'flex-end',
|
|
53
|
-
marginTop: -16,
|
|
54
|
-
},
|
|
55
|
-
quoteEnd: {
|
|
56
|
-
marginBottom: 0,
|
|
57
|
-
},
|
|
58
|
-
text: {
|
|
59
|
-
fontSize: 16,
|
|
60
|
-
lineHeight: 26,
|
|
61
|
-
textAlign: 'center',
|
|
62
|
-
fontStyle: 'italic',
|
|
63
|
-
fontWeight: '500',
|
|
64
|
-
color: tokens.colors.textPrimary,
|
|
65
|
-
paddingBottom: 4,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
-
import { ImageGallery } from "@umituz/react-native-image";
|
|
5
|
-
import { AtomicIcon, AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
6
|
-
import type { Creation } from "../../domain/entities/Creation";
|
|
7
|
-
|
|
8
|
-
interface CreationImageViewerProps {
|
|
9
|
-
readonly creations: Creation[];
|
|
10
|
-
readonly visible: boolean;
|
|
11
|
-
readonly index: number;
|
|
12
|
-
readonly enableEditing?: boolean;
|
|
13
|
-
readonly onDismiss: () => void;
|
|
14
|
-
readonly onIndexChange: (index: number) => void;
|
|
15
|
-
readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
|
|
16
|
-
readonly selectedCreationId?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const CreationImageViewer: React.FC<CreationImageViewerProps> = ({
|
|
20
|
-
creations,
|
|
21
|
-
visible,
|
|
22
|
-
index,
|
|
23
|
-
enableEditing = false,
|
|
24
|
-
onDismiss,
|
|
25
|
-
onIndexChange,
|
|
26
|
-
onImageEdit,
|
|
27
|
-
selectedCreationId,
|
|
28
|
-
}) => {
|
|
29
|
-
const tokens = useAppDesignTokens();
|
|
30
|
-
const insets = useSafeAreaInsets();
|
|
31
|
-
|
|
32
|
-
const handleImageChange = async (uri: string) => {
|
|
33
|
-
if (selectedCreationId && onImageEdit) {
|
|
34
|
-
await onImageEdit(uri, selectedCreationId);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
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="onPrimary" />
|
|
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: 999,
|
|
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
|
-
|
|
89
|
-
return (
|
|
90
|
-
<ImageGallery
|
|
91
|
-
images={creations.map((c) => ({ uri: c.uri }))}
|
|
92
|
-
visible={visible}
|
|
93
|
-
index={index}
|
|
94
|
-
onDismiss={onDismiss}
|
|
95
|
-
onIndexChange={onIndexChange}
|
|
96
|
-
HeaderComponent={HeaderComponent}
|
|
97
|
-
{...(enableEditing && { enableEditing } as any)}
|
|
98
|
-
{...(onImageEdit && { onImageChange: handleImageChange } as any)}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CreationThumbnail Component
|
|
3
|
-
* Displays a single creation thumbnail
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useMemo, useState } from "react";
|
|
7
|
-
import { Image, TouchableOpacity, StyleSheet, View } from "react-native";
|
|
8
|
-
import {
|
|
9
|
-
useAppDesignTokens,
|
|
10
|
-
AtomicIcon,
|
|
11
|
-
} from "@umituz/react-native-design-system";
|
|
12
|
-
|
|
13
|
-
interface CreationThumbnailProps {
|
|
14
|
-
readonly uri: string;
|
|
15
|
-
readonly size?: number;
|
|
16
|
-
readonly onPress?: () => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function CreationThumbnail({
|
|
20
|
-
uri,
|
|
21
|
-
size = 72,
|
|
22
|
-
onPress,
|
|
23
|
-
}: CreationThumbnailProps) {
|
|
24
|
-
const tokens = useAppDesignTokens();
|
|
25
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
26
|
-
|
|
27
|
-
const styles = useMemo(
|
|
28
|
-
() =>
|
|
29
|
-
StyleSheet.create({
|
|
30
|
-
thumbnail: {
|
|
31
|
-
width: size,
|
|
32
|
-
height: size,
|
|
33
|
-
borderRadius: tokens.spacing.sm,
|
|
34
|
-
backgroundColor: tokens.colors.backgroundSecondary,
|
|
35
|
-
},
|
|
36
|
-
overlay: {
|
|
37
|
-
...StyleSheet.absoluteFillObject,
|
|
38
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
39
|
-
borderRadius: tokens.spacing.sm,
|
|
40
|
-
justifyContent: "center",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
[tokens, size]
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<TouchableOpacity
|
|
49
|
-
onPress={onPress}
|
|
50
|
-
disabled={!onPress}
|
|
51
|
-
onPressIn={() => setIsPressed(true)}
|
|
52
|
-
onPressOut={() => setIsPressed(false)}
|
|
53
|
-
activeOpacity={1}
|
|
54
|
-
>
|
|
55
|
-
<Image source={{ uri }} style={styles.thumbnail} />
|
|
56
|
-
{isPressed && onPress && (
|
|
57
|
-
<View style={styles.overlay}>
|
|
58
|
-
<AtomicIcon name="eye" size="lg" color="textInverse" />
|
|
59
|
-
</View>
|
|
60
|
-
)}
|
|
61
|
-
</TouchableOpacity>
|
|
62
|
-
);
|
|
63
|
-
}
|