@umituz/react-native-ai-generation-content 1.17.86 → 1.17.88
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/index.ts +6 -3
- package/src/domains/creations/presentation/components/CreationBadges.tsx +3 -3
- package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +5 -8
- package/src/domains/creations/presentation/components/CreationThumbnail.tsx +1 -1
- package/src/domains/creations/presentation/components/index.ts +0 -3
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +5 -4
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +2 -11
- package/src/domains/creations/presentation/utils/filterUtils.ts +18 -1
- package/src/domains/flashcard-generation/FlashcardGenerationService.ts +85 -311
- package/src/domains/flashcard-generation/builders/flashcard-prompt.builder.ts +55 -0
- package/src/domains/flashcard-generation/parsers/flashcard-response.parser.ts +68 -0
- package/src/domains/flashcard-generation/types/flashcard.types.ts +56 -0
- package/src/domains/flashcard-generation/validators/flashcard.validator.ts +67 -0
- package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +3 -3
- package/src/features/replace-background/presentation/components/ResultDisplay.tsx +1 -2
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +3 -4
- package/src/features/text-to-image/domain/constants/index.ts +3 -3
- package/src/features/text-to-image/domain/constants/options.constants.ts +12 -25
- package/src/features/text-to-image/index.ts +12 -4
- package/src/features/text-to-image/presentation/hooks/index.ts +8 -0
- package/src/features/text-to-image/presentation/hooks/useTextToImageCallbacksBuilder.ts +200 -0
- package/src/features/text-to-video/presentation/components/HeroSection.tsx +2 -8
- package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +3 -5
- package/src/presentation/components/AIGenerationForm.tsx +0 -1
- package/src/presentation/components/AIGenerationHero.tsx +27 -24
- package/src/presentation/components/GenerationProgressContent.tsx +4 -2
- package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +12 -26
- package/src/presentation/components/StylePresetsGrid.tsx +5 -3
- package/src/presentation/components/buttons/GenerateButton.tsx +39 -102
- package/src/presentation/components/headers/FeatureHeader.tsx +15 -9
- package/src/presentation/components/image-picker/DualImagePicker.tsx +0 -6
- package/src/presentation/components/image-picker/ImagePickerBox.tsx +27 -16
- package/src/presentation/components/modals/SettingsSheet.tsx +4 -2
- package/src/presentation/components/result/ResultImageCard.tsx +12 -35
- package/src/presentation/components/result/ResultStoryCard.tsx +10 -16
- package/src/domains/creations/presentation/components/CreationsProvider.tsx +0 -56
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ImagePickerBox Component
|
|
3
|
-
* Generic image picker box with
|
|
3
|
+
* Generic image picker box with solid color design
|
|
4
4
|
* Props-driven for 100+ apps compatibility
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -17,14 +17,12 @@ import {
|
|
|
17
17
|
useAppDesignTokens,
|
|
18
18
|
AtomicIcon,
|
|
19
19
|
} from "@umituz/react-native-design-system";
|
|
20
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
21
20
|
|
|
22
21
|
export interface ImagePickerBoxProps {
|
|
23
22
|
readonly imageUri: string | null;
|
|
24
23
|
readonly isDisabled?: boolean;
|
|
25
24
|
readonly onPress: () => void;
|
|
26
25
|
readonly placeholderText: string;
|
|
27
|
-
readonly gradientColors?: readonly [string, string, ...string[]];
|
|
28
26
|
readonly variant?: "portrait" | "square" | "landscape";
|
|
29
27
|
readonly size?: "sm" | "md" | "lg";
|
|
30
28
|
readonly uploadIcon?: string;
|
|
@@ -44,7 +42,6 @@ export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
|
|
|
44
42
|
isDisabled = false,
|
|
45
43
|
onPress,
|
|
46
44
|
placeholderText,
|
|
47
|
-
gradientColors = ["#667eea", "#764ba2"],
|
|
48
45
|
variant = "portrait",
|
|
49
46
|
size = "md",
|
|
50
47
|
uploadIcon = "cloud-upload-outline",
|
|
@@ -70,42 +67,57 @@ export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
|
|
|
70
67
|
{imageUri ? (
|
|
71
68
|
<View style={styles.imageContainer}>
|
|
72
69
|
<Image source={{ uri: imageUri }} style={styles.image} />
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
<View
|
|
71
|
+
style={[
|
|
72
|
+
styles.imageOverlay,
|
|
73
|
+
{ backgroundColor: tokens.colors.modalOverlay },
|
|
74
|
+
]}
|
|
76
75
|
>
|
|
77
76
|
<View
|
|
78
77
|
style={[
|
|
79
78
|
styles.editBadge,
|
|
80
|
-
{ backgroundColor:
|
|
79
|
+
{ backgroundColor: tokens.colors.primary },
|
|
81
80
|
]}
|
|
82
81
|
>
|
|
83
82
|
<AtomicIcon
|
|
84
83
|
name={editIcon}
|
|
85
84
|
customSize={Math.round(16 * multiplier)}
|
|
86
|
-
customColor=
|
|
85
|
+
customColor={tokens.colors.textInverse}
|
|
87
86
|
/>
|
|
88
87
|
</View>
|
|
89
|
-
</
|
|
88
|
+
</View>
|
|
90
89
|
</View>
|
|
91
90
|
) : (
|
|
92
|
-
<
|
|
91
|
+
<View
|
|
92
|
+
style={[
|
|
93
|
+
styles.placeholder,
|
|
94
|
+
{ backgroundColor: tokens.colors.primary },
|
|
95
|
+
]}
|
|
96
|
+
>
|
|
93
97
|
<View style={styles.placeholderContent}>
|
|
94
|
-
<View
|
|
98
|
+
<View
|
|
99
|
+
style={[
|
|
100
|
+
styles.uploadIconContainer,
|
|
101
|
+
{ backgroundColor: tokens.colors.surface },
|
|
102
|
+
]}
|
|
103
|
+
>
|
|
95
104
|
<AtomicIcon
|
|
96
105
|
name={uploadIcon}
|
|
97
106
|
customSize={iconSize}
|
|
98
|
-
customColor=
|
|
107
|
+
customColor={tokens.colors.primary}
|
|
99
108
|
/>
|
|
100
109
|
</View>
|
|
101
110
|
<AtomicText
|
|
102
111
|
type="bodyMedium"
|
|
103
|
-
style={[
|
|
112
|
+
style={[
|
|
113
|
+
styles.placeholderText,
|
|
114
|
+
{ color: tokens.colors.textInverse },
|
|
115
|
+
]}
|
|
104
116
|
>
|
|
105
117
|
{placeholderText}
|
|
106
118
|
</AtomicText>
|
|
107
119
|
</View>
|
|
108
|
-
</
|
|
120
|
+
</View>
|
|
109
121
|
)}
|
|
110
122
|
</TouchableOpacity>
|
|
111
123
|
</View>
|
|
@@ -153,7 +165,6 @@ const styles = StyleSheet.create({
|
|
|
153
165
|
paddingHorizontal: 16,
|
|
154
166
|
},
|
|
155
167
|
uploadIconContainer: {
|
|
156
|
-
backgroundColor: "rgba(255,255,255,0.2)",
|
|
157
168
|
borderRadius: 40,
|
|
158
169
|
padding: 16,
|
|
159
170
|
marginBottom: 12,
|
|
@@ -53,7 +53,10 @@ export const SettingsSheet: React.FC<SettingsSheetProps> = ({
|
|
|
53
53
|
animationType="slide"
|
|
54
54
|
onRequestClose={onClose}
|
|
55
55
|
>
|
|
56
|
-
<Pressable
|
|
56
|
+
<Pressable
|
|
57
|
+
style={[styles.backdrop, { backgroundColor: tokens.colors.modalOverlay }]}
|
|
58
|
+
onPress={handleBackdropPress}
|
|
59
|
+
>
|
|
57
60
|
<Pressable
|
|
58
61
|
style={[
|
|
59
62
|
styles.sheet,
|
|
@@ -102,7 +105,6 @@ export const SettingsSheet: React.FC<SettingsSheetProps> = ({
|
|
|
102
105
|
const styles = StyleSheet.create({
|
|
103
106
|
backdrop: {
|
|
104
107
|
flex: 1,
|
|
105
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
106
108
|
justifyContent: "flex-end",
|
|
107
109
|
},
|
|
108
110
|
sheet: {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
AtomicIcon,
|
|
12
12
|
useAppDesignTokens,
|
|
13
13
|
} from "@umituz/react-native-design-system";
|
|
14
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
15
14
|
import type { ResultImageConfig } from "../../types/result-config.types";
|
|
16
15
|
import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
|
|
17
16
|
|
|
@@ -45,12 +44,12 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
|
|
|
45
44
|
|
|
46
45
|
const badgeBackground = useMemo(() => {
|
|
47
46
|
if (cfg.badgeStyle === "light") {
|
|
48
|
-
return
|
|
47
|
+
return tokens.colors.surface;
|
|
49
48
|
} else if (cfg.badgeStyle === "dark") {
|
|
50
|
-
return
|
|
49
|
+
return tokens.colors.modalOverlay;
|
|
51
50
|
}
|
|
52
|
-
return
|
|
53
|
-
}, [cfg.badgeStyle]);
|
|
51
|
+
return tokens.colors.primary;
|
|
52
|
+
}, [cfg.badgeStyle, tokens]);
|
|
54
53
|
|
|
55
54
|
const styles = useMemo(
|
|
56
55
|
() =>
|
|
@@ -76,24 +75,17 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
|
|
|
76
75
|
gap: 4,
|
|
77
76
|
paddingHorizontal: 10,
|
|
78
77
|
paddingVertical: 5,
|
|
79
|
-
backgroundColor: badgeBackground
|
|
78
|
+
backgroundColor: badgeBackground,
|
|
80
79
|
borderRadius: 12,
|
|
81
80
|
overflow: "hidden",
|
|
82
81
|
},
|
|
83
|
-
gradientBadge: {
|
|
84
|
-
flexDirection: "row",
|
|
85
|
-
alignItems: "center",
|
|
86
|
-
gap: 4,
|
|
87
|
-
paddingHorizontal: 10,
|
|
88
|
-
paddingVertical: 5,
|
|
89
|
-
},
|
|
90
82
|
badgeText: {
|
|
91
83
|
fontSize: 10,
|
|
92
84
|
fontWeight: "700",
|
|
93
85
|
color:
|
|
94
86
|
cfg.badgeStyle === "light"
|
|
95
87
|
? tokens.colors.textPrimary
|
|
96
|
-
:
|
|
88
|
+
: tokens.colors.textInverse,
|
|
97
89
|
letterSpacing: 0.5,
|
|
98
90
|
},
|
|
99
91
|
}),
|
|
@@ -104,35 +96,20 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
|
|
|
104
96
|
if (!cfg.showBadge) return null;
|
|
105
97
|
|
|
106
98
|
const iconColor =
|
|
107
|
-
cfg.badgeStyle === "light"
|
|
99
|
+
cfg.badgeStyle === "light"
|
|
100
|
+
? tokens.colors.primary
|
|
101
|
+
: tokens.colors.textInverse;
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
return (
|
|
104
|
+
<View style={styles.badge}>
|
|
111
105
|
<AtomicIcon
|
|
112
106
|
name={cfg.badgeIcon ?? "sparkles"}
|
|
113
107
|
size="xs"
|
|
114
108
|
customColor={iconColor}
|
|
115
109
|
/>
|
|
116
110
|
<AtomicText style={styles.badgeText}>{badgeText}</AtomicText>
|
|
117
|
-
|
|
111
|
+
</View>
|
|
118
112
|
);
|
|
119
|
-
|
|
120
|
-
if (cfg.badgeStyle === "gradient") {
|
|
121
|
-
return (
|
|
122
|
-
<View style={styles.badge}>
|
|
123
|
-
<LinearGradient
|
|
124
|
-
colors={[tokens.colors.primary, tokens.colors.secondary]}
|
|
125
|
-
start={{ x: 0, y: 0 }}
|
|
126
|
-
end={{ x: 1, y: 0 }}
|
|
127
|
-
style={styles.gradientBadge}
|
|
128
|
-
>
|
|
129
|
-
{badgeContent}
|
|
130
|
-
</LinearGradient>
|
|
131
|
-
</View>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return <View style={styles.badge}>{badgeContent}</View>;
|
|
136
113
|
};
|
|
137
114
|
|
|
138
115
|
return (
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
AtomicText,
|
|
11
11
|
useAppDesignTokens,
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
13
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
14
13
|
import type { ResultStoryConfig } from "../../types/result-config.types";
|
|
15
14
|
import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
|
|
16
15
|
|
|
@@ -37,16 +36,24 @@ export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({
|
|
|
37
36
|
...base,
|
|
38
37
|
borderWidth: 1,
|
|
39
38
|
borderColor: tokens.colors.primaryContainer,
|
|
40
|
-
backgroundColor:
|
|
39
|
+
backgroundColor: tokens.colors.surface,
|
|
41
40
|
};
|
|
42
41
|
} else if (cfg.borderStyle === "filled") {
|
|
43
42
|
return {
|
|
44
43
|
...base,
|
|
45
44
|
backgroundColor: tokens.colors.primaryContainer,
|
|
46
45
|
};
|
|
46
|
+
} else if (cfg.borderStyle === "gradient") {
|
|
47
|
+
return {
|
|
48
|
+
...base,
|
|
49
|
+
backgroundColor: tokens.colors.primaryContainer,
|
|
50
|
+
};
|
|
47
51
|
}
|
|
48
52
|
|
|
49
|
-
return
|
|
53
|
+
return {
|
|
54
|
+
...base,
|
|
55
|
+
backgroundColor: tokens.colors.surface,
|
|
56
|
+
};
|
|
50
57
|
}, [cfg.borderStyle, cfg.spacing, tokens]);
|
|
51
58
|
|
|
52
59
|
const styles = useMemo(
|
|
@@ -102,19 +109,6 @@ export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({
|
|
|
102
109
|
</>
|
|
103
110
|
);
|
|
104
111
|
|
|
105
|
-
if (cfg.borderStyle === "gradient") {
|
|
106
|
-
return (
|
|
107
|
-
<View style={styles.outer}>
|
|
108
|
-
<LinearGradient
|
|
109
|
-
colors={[tokens.colors.primaryContainer, tokens.colors.surface]}
|
|
110
|
-
style={styles.container}
|
|
111
|
-
>
|
|
112
|
-
{renderContent()}
|
|
113
|
-
</LinearGradient>
|
|
114
|
-
</View>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
112
|
return (
|
|
119
113
|
<View style={styles.outer}>
|
|
120
114
|
<View style={styles.container}>{renderContent()}</View>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creations Provider
|
|
3
|
-
* Context provider for creations configuration and localization
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { createContext, useContext, useMemo, type ReactNode } from "react";
|
|
7
|
-
import type { CreationsConfig, CreationType } from "../../domain/value-objects/CreationsConfig";
|
|
8
|
-
import { getTranslatedTypes } from "../utils/filterUtils";
|
|
9
|
-
|
|
10
|
-
interface CreationsContextValue {
|
|
11
|
-
config: CreationsConfig;
|
|
12
|
-
t: (key: string) => string;
|
|
13
|
-
translatedTypes: readonly CreationType[];
|
|
14
|
-
getLocalizedTitle: (typeId: string) => string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const CreationsContext = createContext<CreationsContextValue | null>(null);
|
|
18
|
-
|
|
19
|
-
interface CreationsProviderProps {
|
|
20
|
-
config: CreationsConfig;
|
|
21
|
-
t: (key: string) => string;
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function CreationsProvider({ config, t, children }: CreationsProviderProps) {
|
|
26
|
-
const translatedTypes = useMemo(() => getTranslatedTypes(config, t), [config, t]);
|
|
27
|
-
|
|
28
|
-
const getLocalizedTitle = (typeId: string): string => {
|
|
29
|
-
const typeConfig = translatedTypes.find((type) => type.id === typeId);
|
|
30
|
-
return typeConfig?.labelKey || typeId;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const value = useMemo<CreationsContextValue>(
|
|
34
|
-
() => ({
|
|
35
|
-
config,
|
|
36
|
-
t,
|
|
37
|
-
translatedTypes,
|
|
38
|
-
getLocalizedTitle,
|
|
39
|
-
}),
|
|
40
|
-
[config, t, translatedTypes]
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<CreationsContext.Provider value={value}>
|
|
45
|
-
{children}
|
|
46
|
-
</CreationsContext.Provider>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function useCreationsProvider(): CreationsContextValue {
|
|
51
|
-
const context = useContext(CreationsContext);
|
|
52
|
-
if (!context) {
|
|
53
|
-
throw new Error("useCreationsProvider must be used within a CreationsProvider");
|
|
54
|
-
}
|
|
55
|
-
return context;
|
|
56
|
-
}
|