@umituz/react-native-ai-generation-content 1.12.24 → 1.12.26
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 +2 -2
- package/src/domains/creations/application/services/CreationsService.ts +73 -0
- package/src/domains/creations/domain/entities/Creation.ts +60 -0
- package/src/domains/creations/domain/entities/index.ts +6 -0
- package/src/domains/creations/domain/repositories/ICreationsRepository.ts +23 -0
- package/src/domains/creations/domain/repositories/index.ts +5 -0
- package/src/domains/creations/domain/services/ICreationsStorageService.ts +13 -0
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +75 -0
- package/src/domains/creations/domain/value-objects/index.ts +12 -0
- package/src/domains/creations/index.ts +84 -0
- package/src/domains/creations/infrastructure/adapters/createRepository.ts +54 -0
- package/src/domains/creations/infrastructure/adapters/index.ts +5 -0
- package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +241 -0
- package/src/domains/creations/infrastructure/repositories/index.ts +8 -0
- package/src/domains/creations/infrastructure/services/CreationsStorageService.ts +49 -0
- package/src/domains/creations/presentation/components/CreationCard.tsx +136 -0
- package/src/domains/creations/presentation/components/CreationDetail/DetailActions.tsx +76 -0
- package/src/domains/creations/presentation/components/CreationDetail/DetailHeader.tsx +81 -0
- package/src/domains/creations/presentation/components/CreationDetail/DetailImage.tsx +41 -0
- package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +67 -0
- package/src/domains/creations/presentation/components/CreationDetail/index.ts +4 -0
- package/src/domains/creations/presentation/components/CreationImageViewer.tsx +43 -0
- package/src/domains/creations/presentation/components/CreationThumbnail.tsx +63 -0
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +75 -0
- package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +176 -0
- package/src/domains/creations/presentation/components/EmptyState.tsx +82 -0
- package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +160 -0
- package/src/domains/creations/presentation/components/FilterChips.tsx +105 -0
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +106 -0
- package/src/domains/creations/presentation/components/index.ts +19 -0
- package/src/domains/creations/presentation/hooks/index.ts +7 -0
- package/src/domains/creations/presentation/hooks/useCreations.ts +38 -0
- package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +77 -0
- package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +51 -0
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +78 -0
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +217 -0
- package/src/domains/creations/presentation/screens/index.ts +5 -0
- package/src/domains/creations/presentation/utils/filterUtils.ts +52 -0
- package/src/domains/creations/types.d.ts +42 -0
- package/src/features/background/presentation/components/ComparisonSlider.tsx +4 -4
- package/src/features/background/presentation/components/ErrorDisplay.tsx +3 -3
- package/src/features/background/presentation/components/FeatureHeader.tsx +1 -1
- package/src/features/background/presentation/components/GenerateButton.tsx +0 -2
- package/src/features/background/presentation/components/ImagePicker.tsx +3 -3
- package/src/features/background/presentation/components/ProcessingModal.tsx +2 -2
- package/src/features/background/presentation/components/PromptInput.tsx +5 -5
- package/src/features/background/presentation/components/ResultDisplay.tsx +4 -4
- package/src/index.ts +5 -0
- package/src/presentation/components/GenerationProgressContent.tsx +4 -4
- package/src/presentation/components/PendingJobCard.tsx +2 -2
- package/src/presentation/components/PendingJobCardActions.tsx +2 -2
- package/src/presentation/components/result/GenerationResultContent.tsx +2 -3
- package/src/presentation/hooks/usePhotoGeneration.ts +7 -5
|
@@ -48,10 +48,10 @@ export const ResultDisplay: React.FC<ResultDisplayProps> = memo(
|
|
|
48
48
|
<AtomicIcon
|
|
49
49
|
name="refresh-cw"
|
|
50
50
|
size="md"
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
/>
|
|
53
53
|
<AtomicText
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
style={[styles.actionText, { color: tokens.colors.textPrimary }]}
|
|
56
56
|
>
|
|
57
57
|
{resetButtonText}
|
|
@@ -68,10 +68,10 @@ export const ResultDisplay: React.FC<ResultDisplayProps> = memo(
|
|
|
68
68
|
<AtomicIcon
|
|
69
69
|
name="download"
|
|
70
70
|
size="md"
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
/>
|
|
73
73
|
<AtomicText
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
style={[
|
|
76
76
|
styles.actionText,
|
|
77
77
|
{ color: tokens.colors.backgroundPrimary },
|
package/src/index.ts
CHANGED
|
@@ -234,6 +234,11 @@ export * from "./domains/prompts";
|
|
|
234
234
|
|
|
235
235
|
export * from "./domains/content-moderation";
|
|
236
236
|
|
|
237
|
+
// =============================================================================
|
|
238
|
+
// DOMAINS - Creations
|
|
239
|
+
// =============================================================================
|
|
240
|
+
|
|
241
|
+
export * from "./domains/creations";
|
|
237
242
|
|
|
238
243
|
// =============================================================================
|
|
239
244
|
// DOMAINS - Face Detection
|
|
@@ -45,11 +45,11 @@ export const GenerationProgressContent: React.FC<
|
|
|
45
45
|
return (
|
|
46
46
|
<View style={[styles.modal, { backgroundColor: activeBgColor }]}>
|
|
47
47
|
{title && (
|
|
48
|
-
<AtomicText
|
|
48
|
+
<AtomicText style={[styles.title, { color: activeTextColor }]}>{title}</AtomicText>
|
|
49
49
|
)}
|
|
50
50
|
|
|
51
51
|
{message && (
|
|
52
|
-
<AtomicText
|
|
52
|
+
<AtomicText style={[styles.message, { color: activeTextColor }]}>
|
|
53
53
|
{message}
|
|
54
54
|
</AtomicText>
|
|
55
55
|
)}
|
|
@@ -62,7 +62,7 @@ export const GenerationProgressContent: React.FC<
|
|
|
62
62
|
/>
|
|
63
63
|
|
|
64
64
|
{hint && (
|
|
65
|
-
<AtomicText
|
|
65
|
+
<AtomicText style={[styles.hint, { color: activeTextColor }]}>{hint}</AtomicText>
|
|
66
66
|
)}
|
|
67
67
|
|
|
68
68
|
{onDismiss && (
|
|
@@ -73,7 +73,7 @@ export const GenerationProgressContent: React.FC<
|
|
|
73
73
|
]}
|
|
74
74
|
onPress={onDismiss}
|
|
75
75
|
>
|
|
76
|
-
<AtomicText
|
|
76
|
+
<AtomicText style={styles.dismissText}>{dismissLabel || "OK"}</AtomicText>
|
|
77
77
|
</TouchableOpacity>
|
|
78
78
|
)}
|
|
79
79
|
</View>
|
|
@@ -106,8 +106,8 @@ export function PendingJobCard<TInput = unknown, TResult = unknown>({
|
|
|
106
106
|
)}
|
|
107
107
|
<View style={styles.content}>
|
|
108
108
|
<View>
|
|
109
|
-
{typeLabel && <AtomicText
|
|
110
|
-
<AtomicText
|
|
109
|
+
{typeLabel && <AtomicText style={styles.typeText}>{typeLabel}</AtomicText>}
|
|
110
|
+
<AtomicText style={styles.statusText}>
|
|
111
111
|
{statusText}
|
|
112
112
|
</AtomicText>
|
|
113
113
|
{!isFailed && <PendingJobProgressBar progress={job.progress} />}
|
|
@@ -57,7 +57,7 @@ export const PendingJobCardActions: React.FC<PendingJobCardActionsProps> = ({
|
|
|
57
57
|
style={styles.actionButton}
|
|
58
58
|
onPress={() => onRetry(id)}
|
|
59
59
|
>
|
|
60
|
-
<AtomicText
|
|
60
|
+
<AtomicText style={styles.text}>↻</AtomicText>
|
|
61
61
|
</TouchableOpacity>
|
|
62
62
|
)}
|
|
63
63
|
{onCancel && (
|
|
@@ -65,7 +65,7 @@ export const PendingJobCardActions: React.FC<PendingJobCardActionsProps> = ({
|
|
|
65
65
|
style={styles.actionButton}
|
|
66
66
|
onPress={() => onCancel(id)}
|
|
67
67
|
>
|
|
68
|
-
<AtomicText
|
|
68
|
+
<AtomicText style={styles.errorText}>✕</AtomicText>
|
|
69
69
|
</TouchableOpacity>
|
|
70
70
|
)}
|
|
71
71
|
</View>
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { ScrollView, StyleSheet, Dimensions, type ViewStyle, type StyleProp } from "react-native";
|
|
9
|
-
import { Animated } from "@umituz/react-native-design-system";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
|
+
import { Animated, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
10
|
import { ResultHeader } from "./ResultHeader";
|
|
12
11
|
import { ResultImageCard } from "./ResultImageCard";
|
|
13
12
|
import { ResultStoryCard } from "./ResultStoryCard";
|
|
@@ -55,7 +54,7 @@ export const GenerationResultContent: React.FC<GenerationResultContentProps> = (
|
|
|
55
54
|
container: {
|
|
56
55
|
width: width - 40,
|
|
57
56
|
maxHeight: "90%",
|
|
58
|
-
backgroundColor: tokens.colors.
|
|
57
|
+
backgroundColor: tokens.colors.background,
|
|
59
58
|
borderRadius: 28,
|
|
60
59
|
overflow: "hidden",
|
|
61
60
|
},
|
|
@@ -149,12 +149,12 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
|
|
|
149
149
|
|
|
150
150
|
const errorMessage =
|
|
151
151
|
generationError.type === "network_error" ? alertMessages.networkError :
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
generationError.type === "policy_violation" ? alertMessages.policyViolation :
|
|
153
|
+
generationError.type === "save_failed" ? alertMessages.saveFailed :
|
|
154
|
+
generationError.type === "credit_failed" ? alertMessages.creditFailed :
|
|
155
|
+
alertMessages.unknown;
|
|
156
156
|
|
|
157
|
-
showError("Error", errorMessage);
|
|
157
|
+
void showError("Error", errorMessage);
|
|
158
158
|
onError?.(generationError);
|
|
159
159
|
} finally {
|
|
160
160
|
isGeneratingRef.current = false;
|
|
@@ -170,6 +170,8 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
|
|
|
170
170
|
onSaveComplete,
|
|
171
171
|
createError,
|
|
172
172
|
offlineStore,
|
|
173
|
+
alertMessages,
|
|
174
|
+
showError
|
|
173
175
|
],
|
|
174
176
|
);
|
|
175
177
|
|