@umituz/react-native-ai-generation-content 1.17.1 → 1.17.3

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.
Files changed (63) hide show
  1. package/package.json +1 -1
  2. package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +1 -1
  3. package/src/domains/creations/presentation/hooks/useAdvancedFilter.ts +0 -1
  4. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +9 -6
  5. package/src/domains/face-detection/infrastructure/validators/faceValidator.ts +1 -1
  6. package/src/domains/prompts/infrastructure/services/PromptGenerationService.ts +1 -1
  7. package/src/domains/prompts/presentation/hooks/useFaceSwap.ts +2 -2
  8. package/src/domains/prompts/presentation/hooks/usePromptGeneration.ts +4 -4
  9. package/src/features/image-to-video/domain/index.ts +1 -0
  10. package/src/features/image-to-video/domain/types/image-to-video.types.ts +71 -0
  11. package/src/features/image-to-video/domain/types/index.ts +10 -0
  12. package/src/features/image-to-video/index.ts +27 -0
  13. package/src/features/image-to-video/infrastructure/index.ts +1 -0
  14. package/src/features/image-to-video/infrastructure/services/image-to-video-executor.ts +112 -0
  15. package/src/features/image-to-video/infrastructure/services/index.ts +5 -0
  16. package/src/features/image-to-video/presentation/hooks/index.ts +5 -0
  17. package/src/features/image-to-video/presentation/hooks/useImageToVideoFeature.ts +121 -0
  18. package/src/features/image-to-video/presentation/index.ts +1 -0
  19. package/src/features/text-to-image/domain/index.ts +1 -0
  20. package/src/features/text-to-image/domain/types/index.ts +10 -0
  21. package/src/features/text-to-image/domain/types/text-to-image.types.ts +66 -0
  22. package/src/features/text-to-image/index.ts +27 -1
  23. package/src/features/text-to-image/infrastructure/index.ts +1 -0
  24. package/src/features/text-to-image/infrastructure/services/index.ts +5 -0
  25. package/src/features/text-to-image/infrastructure/services/text-to-image-executor.ts +113 -0
  26. package/src/features/text-to-image/presentation/hooks/index.ts +5 -0
  27. package/src/features/text-to-image/presentation/hooks/useTextToImageFeature.ts +111 -0
  28. package/src/features/text-to-image/presentation/index.ts +1 -0
  29. package/src/features/text-to-video/domain/index.ts +1 -0
  30. package/src/features/text-to-video/domain/types/index.ts +10 -0
  31. package/src/features/text-to-video/domain/types/text-to-video.types.ts +65 -0
  32. package/src/features/text-to-video/index.ts +27 -1
  33. package/src/features/text-to-video/infrastructure/index.ts +1 -0
  34. package/src/features/text-to-video/infrastructure/services/index.ts +5 -0
  35. package/src/features/text-to-video/infrastructure/services/text-to-video-executor.ts +108 -0
  36. package/src/features/text-to-video/presentation/hooks/index.ts +5 -0
  37. package/src/features/text-to-video/presentation/hooks/useTextToVideoFeature.ts +111 -0
  38. package/src/features/text-to-video/presentation/index.ts +1 -0
  39. package/src/features/text-to-voice/domain/index.ts +1 -0
  40. package/src/features/text-to-voice/domain/types/index.ts +10 -0
  41. package/src/features/text-to-voice/domain/types/text-to-voice.types.ts +65 -0
  42. package/src/features/text-to-voice/index.ts +27 -0
  43. package/src/features/text-to-voice/infrastructure/index.ts +1 -0
  44. package/src/features/text-to-voice/infrastructure/services/index.ts +5 -0
  45. package/src/features/text-to-voice/infrastructure/services/text-to-voice-executor.ts +111 -0
  46. package/src/features/text-to-voice/presentation/hooks/index.ts +5 -0
  47. package/src/features/text-to-voice/presentation/hooks/useTextToVoiceFeature.ts +105 -0
  48. package/src/features/text-to-voice/presentation/index.ts +1 -0
  49. package/src/index.ts +24 -0
  50. package/src/presentation/components/buttons/GenerateButton.tsx +141 -0
  51. package/src/presentation/components/buttons/index.ts +1 -0
  52. package/src/presentation/components/display/ErrorDisplay.tsx +111 -0
  53. package/src/presentation/components/display/ResultDisplay.tsx +122 -0
  54. package/src/presentation/components/display/index.ts +6 -0
  55. package/src/presentation/components/headers/FeatureHeader.tsx +85 -0
  56. package/src/presentation/components/headers/index.ts +1 -0
  57. package/src/presentation/components/image-picker/DualImagePicker.tsx +95 -0
  58. package/src/presentation/components/image-picker/ImagePickerBox.tsx +165 -0
  59. package/src/presentation/components/image-picker/index.ts +2 -0
  60. package/src/presentation/components/index.ts +4 -0
  61. package/src/features/text-to-image/domain/entities.ts +0 -58
  62. package/src/features/text-to-video/domain/entities.ts +0 -52
  63. package/src/types/jsx.d.ts +0 -19
@@ -0,0 +1,85 @@
1
+ /**
2
+ * FeatureHeader Component
3
+ * Generic feature header with hero image and description
4
+ * Props-driven for 100+ apps compatibility
5
+ */
6
+
7
+ import React from "react";
8
+ import { View, StyleSheet, ImageBackground } from "react-native";
9
+ import type { ImageSourcePropType } from "react-native";
10
+ import {
11
+ AtomicText,
12
+ useAppDesignTokens,
13
+ } from "@umituz/react-native-design-system";
14
+ import { LinearGradient } from "expo-linear-gradient";
15
+
16
+ export interface FeatureHeaderProps {
17
+ readonly imageSource: ImageSourcePropType;
18
+ readonly description: string;
19
+ readonly gradientColors?: readonly [string, string, ...string[]];
20
+ readonly minHeight?: number;
21
+ }
22
+
23
+ export const FeatureHeader: React.FC<FeatureHeaderProps> = ({
24
+ imageSource,
25
+ description,
26
+ gradientColors = ["rgba(0,0,0,0.3)", "rgba(0,0,0,0.1)", "rgba(0,0,0,0.4)"],
27
+ minHeight = 200,
28
+ }) => {
29
+ const tokens = useAppDesignTokens();
30
+
31
+ return (
32
+ <>
33
+ <View style={styles.headerContainer}>
34
+ <ImageBackground
35
+ source={imageSource}
36
+ style={[styles.heroImage, { minHeight }]}
37
+ imageStyle={styles.heroImageStyle}
38
+ >
39
+ <LinearGradient
40
+ colors={gradientColors}
41
+ style={[styles.gradient, { minHeight }]}
42
+ />
43
+ </ImageBackground>
44
+ </View>
45
+ <AtomicText
46
+ type="bodyLarge"
47
+ style={[
48
+ styles.description,
49
+ {
50
+ color: tokens.colors.textSecondary,
51
+ marginTop: tokens.spacing.md,
52
+ marginBottom: tokens.spacing.md,
53
+ },
54
+ ]}
55
+ >
56
+ {description}
57
+ </AtomicText>
58
+ </>
59
+ );
60
+ };
61
+
62
+ const styles = StyleSheet.create({
63
+ headerContainer: {
64
+ marginBottom: 8,
65
+ borderRadius: 20,
66
+ overflow: "hidden",
67
+ borderWidth: 1,
68
+ borderColor: "rgba(255, 255, 255, 0.1)",
69
+ },
70
+ heroImage: {
71
+ width: "100%",
72
+ },
73
+ heroImageStyle: {
74
+ borderRadius: 20,
75
+ },
76
+ gradient: {
77
+ flex: 1,
78
+ },
79
+ description: {
80
+ textAlign: "center",
81
+ lineHeight: 22,
82
+ paddingHorizontal: 16,
83
+ fontWeight: "500",
84
+ },
85
+ });
@@ -0,0 +1 @@
1
+ export { FeatureHeader, type FeatureHeaderProps } from "./FeatureHeader";
@@ -0,0 +1,95 @@
1
+ /**
2
+ * DualImagePicker Component
3
+ * Two-image picker for face swap, AI hug/kiss features
4
+ * Props-driven for 100+ apps compatibility
5
+ */
6
+
7
+ import React from "react";
8
+ import { View, StyleSheet } from "react-native";
9
+ import { useAppDesignTokens } from "@umituz/react-native-design-system";
10
+ import { ImagePickerBox, type ImagePickerBoxProps } from "./ImagePickerBox";
11
+
12
+ export interface DualImagePickerProps {
13
+ readonly sourceImageUri: string | null;
14
+ readonly targetImageUri: string | null;
15
+ readonly isDisabled?: boolean;
16
+ readonly onSelectSource: () => void;
17
+ readonly onSelectTarget: () => void;
18
+ readonly sourcePlaceholder: string;
19
+ readonly targetPlaceholder: string;
20
+ readonly sourceGradient?: ImagePickerBoxProps["gradientColors"];
21
+ readonly targetGradient?: ImagePickerBoxProps["gradientColors"];
22
+ readonly variant?: ImagePickerBoxProps["variant"];
23
+ readonly layout?: "horizontal" | "vertical";
24
+ }
25
+
26
+ export const DualImagePicker: React.FC<DualImagePickerProps> = ({
27
+ sourceImageUri,
28
+ targetImageUri,
29
+ isDisabled = false,
30
+ onSelectSource,
31
+ onSelectTarget,
32
+ sourcePlaceholder,
33
+ targetPlaceholder,
34
+ sourceGradient = ["#667eea", "#764ba2"],
35
+ targetGradient = ["#f093fb", "#f5576c"],
36
+ variant = "portrait",
37
+ layout = "horizontal",
38
+ }) => {
39
+ const tokens = useAppDesignTokens();
40
+ const isHorizontal = layout === "horizontal";
41
+
42
+ return (
43
+ <View
44
+ style={[
45
+ styles.container,
46
+ isHorizontal ? styles.horizontal : styles.vertical,
47
+ { gap: tokens.spacing.md },
48
+ ]}
49
+ >
50
+ <View style={isHorizontal ? styles.pickerHalf : styles.pickerFull}>
51
+ <ImagePickerBox
52
+ imageUri={sourceImageUri}
53
+ isDisabled={isDisabled}
54
+ onPress={onSelectSource}
55
+ placeholderText={sourcePlaceholder}
56
+ gradientColors={sourceGradient}
57
+ variant={variant}
58
+ />
59
+ </View>
60
+
61
+ <View style={isHorizontal ? styles.pickerHalf : styles.pickerFull}>
62
+ <ImagePickerBox
63
+ imageUri={targetImageUri}
64
+ isDisabled={isDisabled}
65
+ onPress={onSelectTarget}
66
+ placeholderText={targetPlaceholder}
67
+ gradientColors={targetGradient}
68
+ variant={variant}
69
+ />
70
+ </View>
71
+ </View>
72
+ );
73
+ };
74
+
75
+ const styles = StyleSheet.create({
76
+ container: {
77
+ width: "100%",
78
+ },
79
+ horizontal: {
80
+ flexDirection: "row",
81
+ justifyContent: "center",
82
+ },
83
+ vertical: {
84
+ flexDirection: "column",
85
+ alignItems: "center",
86
+ },
87
+ pickerHalf: {
88
+ flex: 1,
89
+ alignItems: "center",
90
+ },
91
+ pickerFull: {
92
+ width: "100%",
93
+ alignItems: "center",
94
+ },
95
+ });
@@ -0,0 +1,165 @@
1
+ /**
2
+ * ImagePickerBox Component
3
+ * Generic image picker box with gradient design
4
+ * Props-driven for 100+ apps compatibility
5
+ */
6
+
7
+ import React from "react";
8
+ import {
9
+ View,
10
+ StyleSheet,
11
+ TouchableOpacity,
12
+ Image,
13
+ type ViewStyle,
14
+ } from "react-native";
15
+ import {
16
+ AtomicText,
17
+ useAppDesignTokens,
18
+ AtomicIcon,
19
+ } from "@umituz/react-native-design-system";
20
+ import { LinearGradient } from "expo-linear-gradient";
21
+
22
+ export interface ImagePickerBoxProps {
23
+ readonly imageUri: string | null;
24
+ readonly isDisabled?: boolean;
25
+ readonly onPress: () => void;
26
+ readonly placeholderText: string;
27
+ readonly gradientColors?: readonly [string, string, ...string[]];
28
+ readonly variant?: "portrait" | "square" | "landscape";
29
+ readonly size?: "sm" | "md" | "lg";
30
+ readonly uploadIcon?: string;
31
+ readonly editIcon?: string;
32
+ }
33
+
34
+ const VARIANT_STYLES: Record<string, ViewStyle> = {
35
+ portrait: { width: 200, height: 280, borderRadius: 20 },
36
+ square: { width: "100%", aspectRatio: 1, borderRadius: 24 },
37
+ landscape: { width: "100%", aspectRatio: 16 / 9, borderRadius: 16 },
38
+ };
39
+
40
+ const SIZE_MULTIPLIERS = { sm: 0.7, md: 1, lg: 1.3 };
41
+
42
+ export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
43
+ imageUri,
44
+ isDisabled = false,
45
+ onPress,
46
+ placeholderText,
47
+ gradientColors = ["#667eea", "#764ba2"],
48
+ variant = "portrait",
49
+ size = "md",
50
+ uploadIcon = "cloud-upload-outline",
51
+ editIcon = "image-outline",
52
+ }) => {
53
+ const tokens = useAppDesignTokens();
54
+ const multiplier = SIZE_MULTIPLIERS[size];
55
+ const baseStyle = VARIANT_STYLES[variant];
56
+ const iconSize = Math.round(32 * multiplier);
57
+
58
+ return (
59
+ <View style={styles.container}>
60
+ <TouchableOpacity
61
+ style={[
62
+ styles.box,
63
+ baseStyle,
64
+ { backgroundColor: tokens.colors.backgroundSecondary },
65
+ ]}
66
+ onPress={onPress}
67
+ disabled={isDisabled}
68
+ activeOpacity={0.8}
69
+ >
70
+ {imageUri ? (
71
+ <View style={styles.imageContainer}>
72
+ <Image source={{ uri: imageUri }} style={styles.image} />
73
+ <LinearGradient
74
+ colors={["transparent", "rgba(0,0,0,0.3)"]}
75
+ style={styles.imageOverlay}
76
+ >
77
+ <View
78
+ style={[
79
+ styles.editBadge,
80
+ { backgroundColor: `${gradientColors[1]}E6` },
81
+ ]}
82
+ >
83
+ <AtomicIcon
84
+ name={editIcon}
85
+ customSize={Math.round(16 * multiplier)}
86
+ customColor="#FFFFFF"
87
+ />
88
+ </View>
89
+ </LinearGradient>
90
+ </View>
91
+ ) : (
92
+ <LinearGradient colors={gradientColors} style={styles.placeholder}>
93
+ <View style={styles.placeholderContent}>
94
+ <View style={styles.uploadIconContainer}>
95
+ <AtomicIcon
96
+ name={uploadIcon}
97
+ customSize={iconSize}
98
+ customColor="#FFFFFF"
99
+ />
100
+ </View>
101
+ <AtomicText
102
+ type="bodyMedium"
103
+ style={[styles.placeholderText, { color: "#FFFFFF" }]}
104
+ >
105
+ {placeholderText}
106
+ </AtomicText>
107
+ </View>
108
+ </LinearGradient>
109
+ )}
110
+ </TouchableOpacity>
111
+ </View>
112
+ );
113
+ };
114
+
115
+ const styles = StyleSheet.create({
116
+ container: {
117
+ marginVertical: 16,
118
+ alignItems: "center",
119
+ },
120
+ box: {
121
+ overflow: "hidden",
122
+ },
123
+ imageContainer: {
124
+ flex: 1,
125
+ position: "relative",
126
+ },
127
+ image: {
128
+ width: "100%",
129
+ height: "100%",
130
+ },
131
+ imageOverlay: {
132
+ position: "absolute",
133
+ bottom: 0,
134
+ left: 0,
135
+ right: 0,
136
+ height: "30%",
137
+ justifyContent: "flex-end",
138
+ alignItems: "flex-end",
139
+ padding: 12,
140
+ },
141
+ editBadge: {
142
+ borderRadius: 20,
143
+ padding: 8,
144
+ },
145
+ placeholder: {
146
+ flex: 1,
147
+ justifyContent: "center",
148
+ alignItems: "center",
149
+ },
150
+ placeholderContent: {
151
+ alignItems: "center",
152
+ justifyContent: "center",
153
+ paddingHorizontal: 16,
154
+ },
155
+ uploadIconContainer: {
156
+ backgroundColor: "rgba(255,255,255,0.2)",
157
+ borderRadius: 40,
158
+ padding: 16,
159
+ marginBottom: 12,
160
+ },
161
+ placeholderText: {
162
+ textAlign: "center",
163
+ fontWeight: "600",
164
+ },
165
+ });
@@ -0,0 +1,2 @@
1
+ export { ImagePickerBox, type ImagePickerBoxProps } from "./ImagePickerBox";
2
+ export { DualImagePicker, type DualImagePickerProps } from "./DualImagePicker";
@@ -23,3 +23,7 @@ export type { PendingJobCardActionsProps } from "./PendingJobCardActions";
23
23
 
24
24
  export * from "./result";
25
25
  export * from "./photo-step";
26
+ export * from "./image-picker";
27
+ export * from "./buttons";
28
+ export * from "./display";
29
+ export * from "./headers";
@@ -1,58 +0,0 @@
1
- /**
2
- * Text-to-Image Domain Entities
3
- */
4
-
5
- export interface TextToImageConfig {
6
- /**
7
- * Width of the generated image
8
- * @default 1024
9
- */
10
- width?: number;
11
-
12
- /**
13
- * Height of the generated image
14
- * @default 1024
15
- */
16
- height?: number;
17
-
18
- /**
19
- * Number of inference steps
20
- * @default 30
21
- */
22
- steps?: number;
23
-
24
- /**
25
- * Guidance scale
26
- * @default 7.5
27
- */
28
- guidanceScale?: number;
29
- }
30
-
31
- export interface TextToImageRequest {
32
- /**
33
- * The description of the image to generate
34
- */
35
- prompt: string;
36
-
37
- /**
38
- * Negative prompt for what to avoid
39
- */
40
- negativePrompt?: string;
41
-
42
- /**
43
- * Optional configuration
44
- */
45
- options?: TextToImageConfig;
46
- }
47
-
48
- export interface TextToImageResult {
49
- /**
50
- * The generated image URL or Base64
51
- */
52
- imageUrl: string;
53
-
54
- /**
55
- * Metadata about the generation
56
- */
57
- metadata?: Record<string, unknown>;
58
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Text to Video Domain Entities
3
- */
4
-
5
- export interface TextToVideoConfig {
6
- /**
7
- * Duration of the video in seconds
8
- * @default 4
9
- */
10
- duration?: number;
11
-
12
- /**
13
- * FPS of the generated video
14
- * @default 24
15
- */
16
- fps?: number;
17
-
18
- /**
19
- * Guidance scale
20
- * @default 7.5
21
- */
22
- guidanceScale?: number;
23
- }
24
-
25
- export interface TextToVideoRequest {
26
- /**
27
- * The text prompt to generate video from
28
- */
29
- prompt: string;
30
-
31
- /**
32
- * Negative prompt
33
- */
34
- negativePrompt?: string;
35
-
36
- /**
37
- * Optional configuration
38
- */
39
- options?: TextToVideoConfig;
40
- }
41
-
42
- export interface TextToVideoResult {
43
- /**
44
- * The generated video URL
45
- */
46
- videoUrl: string;
47
-
48
- /**
49
- * Metadata about the generation
50
- */
51
- metadata?: Record<string, unknown>;
52
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * React 19 JSX Compatibility for React Native
3
- * Fixes JSX namespace issues between React 19 and react-native
4
- */
5
-
6
- import type { JSX as ReactJSX } from 'react';
7
-
8
- declare global {
9
- namespace JSX {
10
- interface Element extends ReactJSX.Element {}
11
- interface ElementClass extends ReactJSX.ElementClass {}
12
- interface ElementAttributesProperty extends ReactJSX.ElementAttributesProperty {}
13
- interface ElementChildrenAttribute extends ReactJSX.ElementChildrenAttribute {}
14
- interface IntrinsicAttributes extends ReactJSX.IntrinsicAttributes {}
15
- interface IntrinsicClassAttributes<T> extends ReactJSX.IntrinsicClassAttributes<T> {}
16
- }
17
- }
18
-
19
- export {};