@umituz/react-native-ai-generation-content 1.89.7 → 1.89.8
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 +1 -1
- package/src/domains/creations/infrastructure/repositories/creation-create.operations.ts +9 -8
- package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.tsx +2 -0
- package/src/domains/result-preview/presentation/components/ResultPreviewScreen.tsx +9 -27
- package/src/domains/result-preview/presentation/types/result-screen.types.ts +4 -0
- package/src/presentation/components/result/SuccessRedirectionCard.tsx +120 -0
- package/src/presentation/components/result/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.8",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -18,19 +18,20 @@ export async function createCreation(
|
|
|
18
18
|
type: creation.type,
|
|
19
19
|
uri: creation.uri,
|
|
20
20
|
createdAt: creation.createdAt,
|
|
21
|
-
deletedAt: undefined,
|
|
22
21
|
metadata: creation.metadata ?? {},
|
|
23
22
|
isShared: creation.isShared ?? false,
|
|
24
23
|
isFavorite: creation.isFavorite ?? false,
|
|
25
|
-
status: creation.status ?? undefined,
|
|
26
|
-
output: creation.output ?? undefined,
|
|
27
|
-
prompt: creation.prompt ?? undefined,
|
|
28
|
-
provider: creation.provider ?? undefined,
|
|
29
|
-
requestId: creation.requestId ?? undefined,
|
|
30
|
-
model: creation.model ?? undefined,
|
|
31
|
-
startedAt: creation.startedAt ?? undefined,
|
|
32
24
|
};
|
|
33
25
|
|
|
26
|
+
// Add optional fields only if they have values (Firestore rejects undefined)
|
|
27
|
+
if (creation.status) data.status = creation.status;
|
|
28
|
+
if (creation.output) data.output = creation.output;
|
|
29
|
+
if (creation.prompt) data.prompt = creation.prompt;
|
|
30
|
+
if (creation.provider) data.provider = creation.provider;
|
|
31
|
+
if (creation.requestId) data.requestId = creation.requestId;
|
|
32
|
+
if (creation.model) data.model = creation.model;
|
|
33
|
+
if (creation.startedAt) data.startedAt = creation.startedAt;
|
|
34
|
+
|
|
34
35
|
try {
|
|
35
36
|
await setDoc(docRef, data);
|
|
36
37
|
} catch (error) {
|
|
@@ -96,6 +96,8 @@ export const WizardStepRenderer: React.FC<WizardStepRendererProps> = ({
|
|
|
96
96
|
sharing: t("generation.result.sharing"),
|
|
97
97
|
tryAnother: t("generation.result.tryAnother"),
|
|
98
98
|
viewCreations: t("generation.result.viewCreations"),
|
|
99
|
+
redirectTitle: t("generator.redirect.title"),
|
|
100
|
+
redirectDescription: t("generator.redirect.description"),
|
|
99
101
|
}}
|
|
100
102
|
/>
|
|
101
103
|
);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
-
import { StyleSheet, View
|
|
3
|
-
import { AtomicText
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { AtomicText } from "@umituz/react-native-design-system/atoms";
|
|
4
4
|
import { NavigationHeader } from "@umituz/react-native-design-system/molecules";
|
|
5
5
|
import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
|
|
6
6
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
7
7
|
import { ResultImageCard } from "./ResultImageCard";
|
|
8
8
|
import { ResultActionBar } from "./ResultActionBar";
|
|
9
|
+
import { SuccessRedirectionCard } from "../../../../presentation/components/result/SuccessRedirectionCard";
|
|
9
10
|
import { RecentCreationsSection } from "./RecentCreationsSection";
|
|
10
11
|
import { VideoResultPlayer } from "../../../../presentation/components/display/VideoResultPlayer";
|
|
11
12
|
import type { ResultPreviewScreenProps } from "../types/result-preview.types";
|
|
@@ -53,22 +54,6 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
|
|
|
53
54
|
color: tokens.colors.textPrimary,
|
|
54
55
|
marginBottom: tokens.spacing.md,
|
|
55
56
|
},
|
|
56
|
-
galleryButton: {
|
|
57
|
-
flexDirection: "row",
|
|
58
|
-
alignItems: "center",
|
|
59
|
-
justifyContent: "space-between",
|
|
60
|
-
backgroundColor: tokens.colors.surfaceSecondary,
|
|
61
|
-
padding: tokens.spacing.md,
|
|
62
|
-
borderRadius: tokens.radius.lg,
|
|
63
|
-
marginTop: tokens.spacing.xl,
|
|
64
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
65
|
-
borderColor: tokens.colors.borderLight,
|
|
66
|
-
},
|
|
67
|
-
galleryButtonText: {
|
|
68
|
-
fontSize: 15,
|
|
69
|
-
fontWeight: "700",
|
|
70
|
-
color: tokens.colors.textPrimary,
|
|
71
|
-
},
|
|
72
57
|
}),
|
|
73
58
|
[tokens]
|
|
74
59
|
);
|
|
@@ -102,16 +87,13 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
|
|
|
102
87
|
showRating={showRating}
|
|
103
88
|
/>
|
|
104
89
|
{onViewCreations && (
|
|
105
|
-
<
|
|
106
|
-
style={styles.galleryButton}
|
|
90
|
+
<SuccessRedirectionCard
|
|
107
91
|
onPress={onViewCreations}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<AtomicIcon name="arrow-forward" size="sm" color="primary" />
|
|
114
|
-
</TouchableOpacity>
|
|
92
|
+
title={translations.redirectTitle || "Your Creation is Ready!"}
|
|
93
|
+
description={translations.redirectDescription || "Head over to the My Creations screen to view full details."}
|
|
94
|
+
buttonText={translations.viewCreations || "View My Creations"}
|
|
95
|
+
style={{ marginTop: tokens.spacing.xl }}
|
|
96
|
+
/>
|
|
115
97
|
)}
|
|
116
98
|
</View>
|
|
117
99
|
{showRecent && recentCreations && translations.recentCreations && translations.viewAll && (
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
AtomicText,
|
|
5
|
+
AtomicIcon,
|
|
6
|
+
} from "@umituz/react-native-design-system/atoms";
|
|
7
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
8
|
+
|
|
9
|
+
export interface SuccessRedirectionCardProps {
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
buttonText: string;
|
|
14
|
+
iconName?: string;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* SuccessRedirectionCard Component
|
|
20
|
+
* A card displayed after successful generation to redirect users to their creations
|
|
21
|
+
*/
|
|
22
|
+
export const SuccessRedirectionCard: React.FC<SuccessRedirectionCardProps> = ({
|
|
23
|
+
onPress,
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
buttonText,
|
|
27
|
+
iconName = "images-outline",
|
|
28
|
+
style,
|
|
29
|
+
}) => {
|
|
30
|
+
const tokens = useAppDesignTokens();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<View
|
|
34
|
+
style={[
|
|
35
|
+
styles.container,
|
|
36
|
+
{
|
|
37
|
+
backgroundColor: tokens.colors.surfaceSecondary,
|
|
38
|
+
borderColor: tokens.colors.borderLight,
|
|
39
|
+
},
|
|
40
|
+
style,
|
|
41
|
+
]}
|
|
42
|
+
>
|
|
43
|
+
<View
|
|
44
|
+
style={[
|
|
45
|
+
styles.iconWrap,
|
|
46
|
+
{ backgroundColor: tokens.colors.backgroundPrimary },
|
|
47
|
+
]}
|
|
48
|
+
>
|
|
49
|
+
<AtomicIcon name={iconName as any} size="xl" color="primary" />
|
|
50
|
+
</View>
|
|
51
|
+
|
|
52
|
+
<AtomicText type="titleSmall" color="textPrimary" style={styles.title}>
|
|
53
|
+
{title}
|
|
54
|
+
</AtomicText>
|
|
55
|
+
|
|
56
|
+
<AtomicText
|
|
57
|
+
type="bodySmall"
|
|
58
|
+
color="textSecondary"
|
|
59
|
+
style={styles.description}
|
|
60
|
+
>
|
|
61
|
+
{description}
|
|
62
|
+
</AtomicText>
|
|
63
|
+
|
|
64
|
+
<TouchableOpacity
|
|
65
|
+
style={[styles.button, { backgroundColor: tokens.colors.primary }]}
|
|
66
|
+
onPress={onPress}
|
|
67
|
+
activeOpacity={0.7}
|
|
68
|
+
>
|
|
69
|
+
<AtomicText
|
|
70
|
+
type="labelMedium"
|
|
71
|
+
color="onPrimary"
|
|
72
|
+
style={styles.buttonText}
|
|
73
|
+
>
|
|
74
|
+
{buttonText}
|
|
75
|
+
</AtomicText>
|
|
76
|
+
<AtomicIcon name="arrow-forward" size="sm" color="onPrimary" />
|
|
77
|
+
</TouchableOpacity>
|
|
78
|
+
</View>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
container: {
|
|
84
|
+
padding: 20,
|
|
85
|
+
borderRadius: 16,
|
|
86
|
+
borderWidth: 1,
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
gap: 8,
|
|
89
|
+
},
|
|
90
|
+
iconWrap: {
|
|
91
|
+
width: 64,
|
|
92
|
+
height: 64,
|
|
93
|
+
borderRadius: 32,
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "center",
|
|
96
|
+
marginBottom: 4,
|
|
97
|
+
},
|
|
98
|
+
title: {
|
|
99
|
+
fontWeight: "700",
|
|
100
|
+
textAlign: "center",
|
|
101
|
+
},
|
|
102
|
+
description: {
|
|
103
|
+
textAlign: "center",
|
|
104
|
+
lineHeight: 20,
|
|
105
|
+
marginBottom: 8,
|
|
106
|
+
},
|
|
107
|
+
button: {
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
justifyContent: "center",
|
|
111
|
+
paddingHorizontal: 24,
|
|
112
|
+
paddingVertical: 14,
|
|
113
|
+
borderRadius: 24,
|
|
114
|
+
gap: 4,
|
|
115
|
+
width: "100%",
|
|
116
|
+
},
|
|
117
|
+
buttonText: {
|
|
118
|
+
fontWeight: "700",
|
|
119
|
+
},
|
|
120
|
+
});
|
|
@@ -20,6 +20,9 @@ export type { ResultStoryCardProps } from "./ResultStoryCard";
|
|
|
20
20
|
export { ResultActions } from "./ResultActions";
|
|
21
21
|
export type { ResultActionsProps } from "./ResultActions";
|
|
22
22
|
|
|
23
|
+
export { SuccessRedirectionCard } from "./SuccessRedirectionCard";
|
|
24
|
+
export type { SuccessRedirectionCardProps } from "./SuccessRedirectionCard";
|
|
25
|
+
|
|
23
26
|
export {
|
|
24
27
|
DEFAULT_RESULT_CONFIG,
|
|
25
28
|
} from "../../types/result-config.types";
|